Update Next.js version across dependencies
The Next.js version has been updated across multiple dependencies in the pnpm-lock file. This ensures consistency, removes instances of the canary version, and aligns all packages to use the stable 14.2.0 release.
This commit is contained in:
66
apps/e2e/tests/team-accounts/team-accounts.po.ts
Normal file
66
apps/e2e/tests/team-accounts/team-accounts.po.ts
Normal file
@@ -0,0 +1,66 @@
|
||||
import { expect, Page } from '@playwright/test';
|
||||
import { AuthPageObject } from '../authentication/auth.po';
|
||||
|
||||
export class TeamAccountsPageObject {
|
||||
private readonly page: Page;
|
||||
public auth: AuthPageObject;
|
||||
|
||||
constructor(page: Page) {
|
||||
this.page = page;
|
||||
this.auth = new AuthPageObject(page);
|
||||
}
|
||||
|
||||
async setup(params = this.createTeamName()) {
|
||||
await this.auth.signUpFlow('/home');
|
||||
await this.createTeam(params);
|
||||
}
|
||||
|
||||
async getTeamFromSelector(teamSlug: string) {
|
||||
await this.openAccountsSelector();
|
||||
|
||||
return this.page.locator(`[data-test="account-selector-team-${teamSlug}"]`);
|
||||
}
|
||||
|
||||
async goToSettings() {
|
||||
await this.page.locator('a', {
|
||||
hasText: 'Settings',
|
||||
}).click();
|
||||
}
|
||||
|
||||
async openAccountsSelector() {
|
||||
await this.page.click('[data-test="account-selector-trigger"]');
|
||||
}
|
||||
|
||||
async createTeam({ teamName, slug } = this.createTeamName()) {
|
||||
await this.openAccountsSelector();
|
||||
|
||||
await this.page.click('[data-test="create-team-account-trigger"]');
|
||||
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}`);
|
||||
}
|
||||
|
||||
async updateName(name: string) {
|
||||
await this.page.fill('[data-test="update-team-account-name-form"] input', name);
|
||||
await this.page.click('[data-test="update-team-account-name-form"] button');
|
||||
}
|
||||
|
||||
async deleteAccount(teamName: string) {
|
||||
await this.page.click('[data-test="delete-team-trigger"]');
|
||||
|
||||
expect(await this.page.locator('[data-test="delete-team-form-confirm-input"]').isVisible()).toBeTruthy();
|
||||
|
||||
await this.page.fill('[data-test="delete-team-form-confirm-input"]', teamName);
|
||||
await this.page.click('[data-test="delete-team-form-confirm-button"]');
|
||||
}
|
||||
|
||||
createTeamName() {
|
||||
const random = (Math.random() * 100).toFixed(0);
|
||||
|
||||
const teamName = `Team-Name-${random}`;
|
||||
const slug = `team-name-${random}`;
|
||||
|
||||
return { teamName, slug };
|
||||
}
|
||||
}
|
||||
44
apps/e2e/tests/team-accounts/team-accounts.spec.ts
Normal file
44
apps/e2e/tests/team-accounts/team-accounts.spec.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
import { expect, Page, test } from '@playwright/test';
|
||||
import { TeamAccountsPageObject } from './team-accounts.po';
|
||||
|
||||
test.describe('Team Accounts', () => {
|
||||
let page: Page;
|
||||
let teamAccounts: TeamAccountsPageObject;
|
||||
|
||||
test.beforeAll(async ({ browser }) => {
|
||||
page = await browser.newPage();
|
||||
teamAccounts = new TeamAccountsPageObject(page);
|
||||
|
||||
await teamAccounts.setup();
|
||||
});
|
||||
|
||||
test('user can update their profile name', async () => {
|
||||
const {teamName, slug} = teamAccounts.createTeamName();
|
||||
|
||||
await teamAccounts.goToSettings();
|
||||
|
||||
await teamAccounts.updateName(teamName);
|
||||
|
||||
await page.waitForURL(`http://localhost:3000/home/${slug}/settings`);
|
||||
|
||||
await expect(await teamAccounts.getTeamFromSelector(slug)).toBeVisible();
|
||||
});
|
||||
});
|
||||
|
||||
test.describe('Account Deletion', () => {
|
||||
test('user can delete their team account', async ({ page }) => {
|
||||
const teamAccounts = new TeamAccountsPageObject(page);
|
||||
const params = teamAccounts.createTeamName();
|
||||
|
||||
await teamAccounts.setup(params);
|
||||
await teamAccounts.goToSettings();
|
||||
|
||||
await teamAccounts.deleteAccount(params.teamName);
|
||||
|
||||
await page.waitForURL('http://localhost:3000/home');
|
||||
|
||||
expect(page.url()).toEqual('http://localhost:3000/home');
|
||||
|
||||
await expect(await teamAccounts.getTeamFromSelector(params.slug)).not.toBeVisible();
|
||||
});
|
||||
});
|
||||
File diff suppressed because it is too large
Load Diff
@@ -57,7 +57,7 @@
|
||||
"i18next": "^23.11.0",
|
||||
"i18next-resources-to-backend": "^1.2.0",
|
||||
"lucide-react": "^0.367.0",
|
||||
"next": "14.2.0-canary.65",
|
||||
"next": "14.2.0",
|
||||
"next-sitemap": "^4.2.3",
|
||||
"next-themes": "0.3.0",
|
||||
"react": "18.2.0",
|
||||
@@ -73,7 +73,7 @@
|
||||
"@kit/prettier-config": "workspace:^",
|
||||
"@kit/tailwind-config": "workspace:^",
|
||||
"@kit/tsconfig": "workspace:^",
|
||||
"@next/bundle-analyzer": "14.2.0-canary.54",
|
||||
"@next/bundle-analyzer": "14.2.0",
|
||||
"@types/mdx": "^2.0.12",
|
||||
"@types/node": "^20.12.7",
|
||||
"@types/react": "^18.2.75",
|
||||
|
||||
@@ -1004,8 +1004,8 @@ create policy invitations_read_self on public.invitations
|
||||
create policy invitations_create_self on public.invitations
|
||||
for insert to authenticated
|
||||
with check (
|
||||
public.has_permission(
|
||||
auth.uid(), account_id, 'invites.manage' ::app_permissions)
|
||||
public.is_set('enable_team_accounts') and
|
||||
public.has_permission(auth.uid(), account_id, 'invites.manage' ::app_permissions)
|
||||
and public.has_more_elevated_role(
|
||||
auth.uid(), account_id, role));
|
||||
|
||||
@@ -1592,7 +1592,7 @@ strict immutable;
|
||||
|
||||
grant execute on function kit.slugify(text) to service_role, authenticated;
|
||||
|
||||
create function kit.set_slug_from_account_name()
|
||||
create or replace function kit.set_slug_from_account_name()
|
||||
returns trigger
|
||||
language plpgsql
|
||||
as $$
|
||||
@@ -1621,7 +1621,7 @@ begin
|
||||
|
||||
for tmp_row in execute (sql_string)
|
||||
loop
|
||||
raise notice '%', tmp_row;
|
||||
raise notice 'tmp_row %', tmp_row;
|
||||
|
||||
tmp_row_count = tmp_row.cnt;
|
||||
|
||||
@@ -1701,7 +1701,8 @@ create trigger on_auth_user_created
|
||||
after insert on auth.users for each row
|
||||
execute procedure kit.setup_new_user();
|
||||
|
||||
create or replace function public.create_account(account_name text)
|
||||
-- Function: create a team account
|
||||
create or replace function public.create_team_account(account_name text)
|
||||
returns public.accounts
|
||||
as $$
|
||||
declare
|
||||
@@ -1723,7 +1724,7 @@ end;
|
||||
$$
|
||||
language plpgsql;
|
||||
|
||||
grant execute on function public.create_account(text) to
|
||||
grant execute on function public.create_team_account(text) to
|
||||
authenticated, service_role;
|
||||
|
||||
-- RLS
|
||||
|
||||
Reference in New Issue
Block a user