From 712f91672084115fda3a94b31111b51b8e0cb288 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 --- .../src/hasuraTriggers/hasuraTriggers.feature | 1 + e2e/tests/api-driven/src/hasuraTriggers/steps.ts | 10 ++++++++++ 2 files changed, 11 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..e76d02c591 100644 --- a/e2e/tests/api-driven/src/hasuraTriggers/steps.ts +++ b/e2e/tests/api-driven/src/hasuraTriggers/steps.ts @@ -22,6 +22,16 @@ 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);