Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add team_settings introspection tests #3909

Merged
merged 1 commit into from
Nov 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
114 changes: 114 additions & 0 deletions hasura.planx.uk/tests/team_settings.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
const { introspectAs } = require("./utils");

describe("team_settings", () => {
describe("public", () => {
let i;
beforeAll(async () => {
i = await introspectAs("public");
});

test("can query team_settings", () => {
expect(i.queries).toContain("team_settings");
});

test("cannot create, update, or delete team_settings", () => {
expect(i).toHaveNoMutationsFor("team_settings");
});
});

describe("admin", () => {
let i;
beforeAll(async () => {
i = await introspectAs("admin");
});

test("can query team_settings and team members", () => {
expect(i.queries).toContain("team_settings");
});
});

describe("platformAdmin", () => {
let i;
beforeAll(async () => {
i = await introspectAs("platformAdmin");
});

test("can query team_settings", () => {
expect(i.queries).toContain("team_settings");
});

test("cannot query insert team_settings", () => {
expect(i.queries).not.toContain("insert_team_settings");
});

test("can query team_settings", async () => {
expect(i.queries).toContain("team_settings");
});

test("can insert team_settings", () => {
expect(i.mutations).toContain("insert_team_settings");
});

test("can mutate team_settings", async () => {
expect(i.mutations).toContain("update_team_settings");
expect(i.mutations).toContain("update_team_settings_by_pk");
});

test("cannot delete team_settings", async () => {
expect(i.mutations).not.toContain("delete_team_settings");
});
});

describe("teamEditor", () => {
beforeAll(async () => {
i = await introspectAs("teamEditor");
});

test("can query team_settings", () => {
expect(i.queries).toContain("team_settings");
});

test("can update team_settings", () => {
expect(i.mutations).toContain("update_team_settings");
expect(i.mutations).toContain("update_team_settings_by_pk");
});

test("cannot delete team_settings", async () => {
expect(i.mutations).not.toContain("delete_team_settings");
});

test("cannot insert team_settings", async () => {
expect(i.mutations).not.toContain("insert_team_settings");
});
});

describe("demoUser", () => {
let i;
beforeAll(async () => {
i = await introspectAs("demoUser");
});

test("can query team_settings", () => {
expect(i.queries).toContain("team_settings");
});

test("cannot create, update, or delete team_settings", () => {
expect(i).toHaveNoMutationsFor("team_settings");
});
});

describe("api", () => {
let i;
beforeAll(async () => {
i = await introspectAs("api");
});

test("can query team_settings", () => {
expect(i.queries).toContain("team_settings");
});

test("cannot create, update, or delete team_settings", () => {
expect(i).toHaveNoMutationsFor("team_settings");
});
});
});
Loading