mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
fix: tests?.
This commit is contained in:
@@ -12,7 +12,7 @@ export function getOrganizationIdFromUrl(pathname: string) {
|
||||
|
||||
export function getProjectIdFromUrl(pathname: string) {
|
||||
// TODO: use base path from svelte here
|
||||
const regex = /\/console\/project-([^/]+)(\/.*)?/;
|
||||
const regex = /\/console\/project-(?:[a-z]{2,3}-)?([^/]+)(\/.*)?/;
|
||||
const match = pathname.match(regex);
|
||||
|
||||
if (match) {
|
||||
|
||||
@@ -14,6 +14,6 @@ test('upgrade - free tier', async ({ page }) => {
|
||||
await enterCreditCard(page);
|
||||
// skip members
|
||||
await page.getByRole('button', { name: 'change plan' }).click();
|
||||
await page.waitForURL('**/console/project-*/overview/platforms');
|
||||
await page.waitForURL(/\/console\/project-(?:[a-z0-9]+-)?([^/]+)\/overview\/platforms/);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -24,7 +24,7 @@ export async function createFreeProject(page: Page): Promise<Metadata> {
|
||||
await page.getByRole('button', { name: 'next' }).click();
|
||||
await page.locator('label').filter({ hasText: 'Frankfurt' }).click();
|
||||
await page.getByRole('button', { name: 'create' }).click();
|
||||
await page.waitForURL('./project-**/overview/platforms');
|
||||
await page.waitForURL(/\/project-(?:[a-z0-9]+-)?([^/]+)\/overview\/platforms/);
|
||||
expect(page.url()).toContain('/console/project-');
|
||||
|
||||
return getProjectIdFromUrl(page.url());
|
||||
|
||||
@@ -49,7 +49,7 @@ export async function createProProject(page: Page): Promise<Metadata> {
|
||||
await page.getByRole('button', { name: 'next' }).click();
|
||||
await page.locator('label').filter({ hasText: 'frankfurt' }).click();
|
||||
await page.getByRole('button', { name: 'create' }).click();
|
||||
await page.waitForURL('./project-**/overview/platforms');
|
||||
await page.waitForURL(/\/project-(?:[a-z0-9]+-)?([^/]+)\/overview\/platforms/);
|
||||
expect(page.url()).toContain('/project-');
|
||||
|
||||
return getProjectIdFromUrl(page.url());
|
||||
|
||||
Reference in New Issue
Block a user