Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

fix: remove toast based verification for deleted auth users (#41360)

Ali Waseem61520cb111cf
diff --git a/e2e/studio/features/auth-users.spec.ts b/e2e/studio/features/auth-users.spec.ts
index 11e6071a901..ddc1dd1b2e6 100644
--- a/e2e/studio/features/auth-users.spec.ts
+++ b/e2e/studio/features/auth-users.spec.ts
@@ -13,29 +13,16 @@ test.describe('auth users list refresh', () => {
const testEmail = `test-create-${Date.now()}@example.com`
const testPassword = 'testpassword123'
- // Create user via UI
+ // Create user via UI - this verifies the user appears in the table
await createUserViaUI(page, ref, testEmail, testPassword)
- // Verify the user appears in the table WITHOUT manually refreshing the page
- const userRow = page.getByRole('row').filter({ hasText: testEmail })
- await expect(
- userRow,
- 'User should appear in the table immediately after creation without manual refresh'
- ).toBeVisible({ timeout: 10_000 })
-
// Verify the user details are correct
+ const userRow = page.getByRole('row').filter({ hasText: testEmail })
await expect(userRow.getByText(testEmail)).toBeVisible()
await expect(userRow.getByText('Email')).toBeVisible()
- // Clean up: delete the user
+ // Clean up: delete the user - this verifies the user is removed from the table
await deleteUserViaUI(page, ref, testEmail)
-
- // Verify the user is removed from the table
- await expect
- .poll(async () => {
- return await page.getByRole('row').filter({ hasText: testEmail }).count()
- }, 'User should be removed from the table after deletion')
- .toBe(0)
})
test('should automatically refresh users list after creating multiple users', async ({
@@ -48,27 +35,14 @@ test.describe('auth users list refresh', () => {
{ email: `test-multi-3-${Date.now()}@example.com`, password: 'testpassword123' },
]
- // Create multiple users
+ // Create multiple users - each creation verifies the user appears in the table
for (const user of testUsers) {
await createUserViaUI(page, ref, user.email, user.password)
-
- // Verify each user appears in the table
- await expect(
- page.getByRole('row').filter({ hasText: user.email }),
- `User ${user.email} should appear in the table after creation`
- ).toBeVisible()
}
- // Clean up: delete all test users
+ // Clean up: delete all test users - each deletion verifies the user is removed
for (const user of testUsers) {
await deleteUserViaUI(page, ref, user.email)
-
- // Verify each user is removed
- await expect
- .poll(async () => {
- return await page.getByRole('row').filter({ hasText: user.email }).count()
- }, `User ${user.email} should be removed from the table after deletion`)
- .toBe(0)
}
})
})
diff --git a/e2e/studio/utils/auth-helpers.ts b/e2e/studio/utils/auth-helpers.ts
index ec639cbdb88..80ace46971f 100644
--- a/e2e/studio/utils/auth-helpers.ts
+++ b/e2e/studio/utils/auth-helpers.ts
@@ -1,11 +1,8 @@
import { expect, Page } from '@playwright/test'
import { waitForApiResponse } from './wait-for-response.js'
-import { dismissToastsIfAny } from './dismiss-toast.js'
import { toUrl } from './to-url.js'
export const createUserViaUI = async (page: Page, ref: string, email: string, password: string) => {
- await dismissToastsIfAny(page)
-
// Open the Add user dropdown
await page.getByRole('button', { name: 'Add user' }).click()
@@ -36,16 +33,15 @@ export const createUserViaUI = async (page: Page, ref: string, email: string, pa
// Wait for both API calls to complete
await Promise.all([createUserPromise, usersListPromise])
- // Wait for success toast
+ // Verify the user appears in the table
+ const userRow = page.getByRole('row').filter({ hasText: email })
await expect(
- page.getByText(`Successfully created user: ${email}`),
- 'Success toast should be visible after user creation'
+ userRow,
+ `User row with email ${email} should be visible after creation`
).toBeVisible({ timeout: 10_000 })
}
export const deleteUserViaUI = async (page: Page, ref: string, email: string) => {
- await dismissToastsIfAny(page)
-
// Find the user row by email and click the checkbox
const userRow = page.getByRole('row').filter({ hasText: email })
await expect(userRow, `User row with email ${email} should be visible`).toBeVisible()
@@ -71,11 +67,18 @@ export const deleteUserViaUI = async (page: Page, ref: string, email: string) =>
// Wait for both API calls to complete
await Promise.all([deleteUserPromise, usersListPromise])
- // Wait for success toast
- await expect(
- page.getByText('Successfully deleted the selected 1 user'),
- 'Success toast should be visible after user deletion'
- ).toBeVisible({ timeout: 10_000 })
+ // Verify the user is removed from the table
+ await expect
+ .poll(
+ async () => {
+ return await userRow.count()
+ },
+ {
+ message: `User row with email ${email} should be removed after deletion`,
+ timeout: 10_000,
+ }
+ )
+ .toBe(0)
}
export const navigateToAuthUsers = async (page: Page, ref: string) => {