From d0e14f97955f46266e7954a8f68c03fc2a5c0946 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dafydd=20Ll=C5=B7r=20Pearson?= Date: Tue, 10 Oct 2023 09:15:21 +0100 Subject: [PATCH] test: Be more explicit in negative case --- .../api-driven/src/hasuraTriggers/hasuraTriggers.feature | 1 + e2e/tests/api-driven/src/hasuraTriggers/steps.ts | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/e2e/tests/api-driven/src/hasuraTriggers/hasuraTriggers.feature b/e2e/tests/api-driven/src/hasuraTriggers/hasuraTriggers.feature index aa9703b8c3..ab3c9b8e0f 100644 --- a/e2e/tests/api-driven/src/hasuraTriggers/hasuraTriggers.feature +++ b/e2e/tests/api-driven/src/hasuraTriggers/hasuraTriggers.feature @@ -9,5 +9,6 @@ Feature: Database triggers @regression @add-user-trigger Scenario: Adding a user to Planx - without Templates team + Given the Templates team does not exist When a new user is added Then they are not granted access to the Templates team \ No newline at end of file diff --git a/e2e/tests/api-driven/src/hasuraTriggers/steps.ts b/e2e/tests/api-driven/src/hasuraTriggers/steps.ts index 389fa259a3..d44878794d 100644 --- a/e2e/tests/api-driven/src/hasuraTriggers/steps.ts +++ b/e2e/tests/api-driven/src/hasuraTriggers/steps.ts @@ -22,6 +22,12 @@ Given("the Templates team exists", async function (this) { this.templatesTeamId = templatesTeamId; }); +Given("the Templates team does not exist", async function (this) { + const templatesTeam = await $admin.team.getBySlug("templates") + + assert.equal(templatesTeam, undefined, "Templates team exists but should not be defined"); +}); + When("a new user is added", async function (this) { const userId = await createUser(); const user = await $admin.user.getById(userId);