Update account management features and improve test configurations

Multiple updates are made to refine the account management features, including updating the 'Your Teams' text to show the number of teams, and modifying the form data validation process in the 'deletePersonalAccountAction' service. Additionally, improvements have been made in test configurations including updating the test timeout settings, taking screenshots when a test fails, and adjusting the location for saving Playwright reports.
This commit is contained in:
giancarlo
2024-04-12 20:52:35 +08:00
parent 24a6190f51
commit 2bad506d75
15 changed files with 93 additions and 51 deletions

View File

@@ -25,6 +25,9 @@ export default defineConfig({
/* Base URL to use in actions like `await page.goto('/')`. */
baseURL: 'http://localhost:3000',
// take a screenshot when a test fails
screenshot: "on",
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: 'on-first-retry',
},

View File

@@ -55,7 +55,9 @@ test.describe('Account Deletion', () => {
await account.setup();
await account.deleteAccount();
await page.waitForURL('http://localhost:3000');
await page.waitForURL('http://localhost:3000', {
timeout: 5000,
});
expect(page.url()).toEqual('http://localhost:3000/');
});

View File

@@ -38,7 +38,9 @@ export class TeamAccountsPageObject {
await this.page.fill('[data-test="create-team-form"] input', teamName);
await this.page.click('[data-test="create-team-form"] button:last-child');
await this.page.waitForURL(`http://localhost:3000/home/${slug}`);
await this.page.waitForURL(`http://localhost:3000/home/${slug}`, {
timeout: 5000,
});
}
async updateName(name: string) {
@@ -56,7 +58,7 @@ export class TeamAccountsPageObject {
}
createTeamName() {
const random = (Math.random() * 1000000000).toFixed(0);
const random = (Math.random() * 10).toFixed(0);
const teamName = `Team-Name-${random}`;
const slug = `team-name-${random}`;

View File

@@ -35,7 +35,9 @@ test.describe('Account Deletion', () => {
await teamAccounts.deleteAccount(params.teamName);
await page.waitForURL('http://localhost:3000/home');
await page.waitForURL('http://localhost:3000/home', {
timeout: 5000,
});
expect(page.url()).toEqual('http://localhost:3000/home');

View File

@@ -18,7 +18,7 @@
"billing": {
"pageTitle": "Billing"
},
"yourTeams": "Your Teams",
"yourTeams": "Your Teams ({{teamsCount}})",
"createTeam": "Create a Team",
"personalAccount": "Personal Account",
"searchAccount": "Search Account...",

View File

@@ -16,8 +16,6 @@ create extension if not exists "unaccent";
-- Create a private Makerkit schema
create schema if not exists kit;
grant USAGE on schema kit to authenticated, authenticated;
-- We remove all default privileges from public schema on functions to
-- prevent public access to them
alter default privileges revoke execute on functions from public;
@@ -1595,6 +1593,8 @@ grant execute on function kit.slugify(text) to service_role, authenticated;
create or replace function kit.set_slug_from_account_name()
returns trigger
language plpgsql
security definer
set search_path = public
as $$
declare
sql_string varchar;
@@ -1616,7 +1616,7 @@ begin
end if;
sql_string = format('select count(1) cnt from accounts where slug = ''' || tmp_slug ||
sql_string = format('select count(1) cnt from public.accounts where slug = ''' || tmp_slug ||
'''; ');
for tmp_row in execute (sql_string)