def METHOD_NAME(
    dashboard_id: int, permalink_salt: str, test_client, login_as_admin
) -> None:
    resp = test_client.post(f"api/v1/dashboard/{dashboard_id}/permalink", json=STATE)
    assert resp.status_code == 201
    data = resp.json
    key = data["key"]
    url = data["url"]
    assert key in url
    id_ = decode_permalink_id(key, permalink_salt)
    assert (
        data
        == test_client.post(
            f"api/v1/dashboard/{dashboard_id}/permalink", json=STATE
        ).json
    ), "Should always return the same permalink key for the same payload"
    db.session.query(KeyValueEntry).filter_by(id=id_).delete()
    db.session.commit()