From 2af447afffd7d30e8be40d58532bc9acaa3083b3 Mon Sep 17 00:00:00 2001 From: Pranav C Date: Wed, 11 Oct 2023 06:25:51 +0000 Subject: [PATCH] fix: remove extra `/` --- packages/nocodb/tests/unit/factory/base.ts | 6 +++--- packages/nocodb/tests/unit/factory/table.ts | 2 +- tests/playwright/pages/Dashboard/TreeView.ts | 2 +- tests/playwright/pages/ProjectsPage/index.ts | 4 ++-- tests/playwright/tests/db/features/swagger.spec.ts | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/nocodb/tests/unit/factory/base.ts b/packages/nocodb/tests/unit/factory/base.ts index ac5ef7b3e6..a77f46b2c6 100644 --- a/packages/nocodb/tests/unit/factory/base.ts +++ b/packages/nocodb/tests/unit/factory/base.ts @@ -59,7 +59,7 @@ const defaultSharedBaseValue = { const createSharedBase = async (app, token, base, sharedBaseArgs = {}) => { await request(app) - .post(`//api/v1/db/meta/bases/${base.id}/shared`) + .post(`/api/v1/db/meta/bases/${base.id}/shared`) .set('xc-auth', token) .send({ ...defaultSharedBaseValue, @@ -69,7 +69,7 @@ const createSharedBase = async (app, token, base, sharedBaseArgs = {}) => { const createSakilaProject = async (context) => { const response = await request(context.app) - .post('//api/v1/db/meta/bases/') + .post('/api/v1/db/meta/bases/') .set('xc-auth', context.token) .send(sakilaProjectConfig(context)); @@ -81,7 +81,7 @@ const createProject = async ( baseArgs: ProjectArgs = defaultProjectValue, ) => { const response = await request(context.app) - .post('//api/v1/db/meta/bases/') + .post('/api/v1/db/meta/bases/') .set('xc-auth', context.token) .send({ ...baseArgs, diff --git a/packages/nocodb/tests/unit/factory/table.ts b/packages/nocodb/tests/unit/factory/table.ts index 2bf7e2c105..5d8040530d 100644 --- a/packages/nocodb/tests/unit/factory/table.ts +++ b/packages/nocodb/tests/unit/factory/table.ts @@ -12,7 +12,7 @@ const defaultTableValue = (context) => ({ const createTable = async (context, base, args = {}) => { const defaultValue = defaultTableValue(context); const response = await request(context.app) - .post(`//api/v1/db/meta/bases/${base.id}/tables`) + .post(`/api/v1/db/meta/bases/${base.id}/tables`) .set('xc-auth', context.token) .send({ ...defaultValue, ...args }); diff --git a/tests/playwright/pages/Dashboard/TreeView.ts b/tests/playwright/pages/Dashboard/TreeView.ts index a5f7bd14e1..5d0575befb 100644 --- a/tests/playwright/pages/Dashboard/TreeView.ts +++ b/tests/playwright/pages/Dashboard/TreeView.ts @@ -143,7 +143,7 @@ export class TreeViewPage extends BasePage { await this.waitForResponse({ uiAction: () => this.dashboard.get().locator('button:has-text("Create Table")').click(), httpMethodsToMatch: ['POST'], - requestUrlPathToMatch: `//api/v1/db/meta/bases/`, + requestUrlPathToMatch: `/api/v1/db/meta/bases/`, responseJsonMatcher: json => json.title === title && json.type === 'table', }); diff --git a/tests/playwright/pages/ProjectsPage/index.ts b/tests/playwright/pages/ProjectsPage/index.ts index 7b043a7c98..c840ea5a02 100644 --- a/tests/playwright/pages/ProjectsPage/index.ts +++ b/tests/playwright/pages/ProjectsPage/index.ts @@ -41,7 +41,7 @@ export class ProjectsPage extends BasePage { await this.waitForResponse({ uiAction: createProjectSubmitAction, httpMethodsToMatch: ['POST'], - requestUrlPathToMatch: '//api/v1/db/meta/bases/', + requestUrlPathToMatch: '/api/v1/db/meta/bases/', }); // wait for dashboard to render @@ -180,7 +180,7 @@ export class ProjectsPage extends BasePage { await this.waitForResponse({ uiAction: deleteProjectAction, httpMethodsToMatch: ['DELETE'], - requestUrlPathToMatch: '//api/v1/db/meta/bases/', + requestUrlPathToMatch: '/api/v1/db/meta/bases/', }); await this.get().locator('.ant-table-row', { hasText: title }).waitFor({ state: 'hidden' }); diff --git a/tests/playwright/tests/db/features/swagger.spec.ts b/tests/playwright/tests/db/features/swagger.spec.ts index 499016d3bb..cf864b7d9c 100644 --- a/tests/playwright/tests/db/features/swagger.spec.ts +++ b/tests/playwright/tests/db/features/swagger.spec.ts @@ -17,7 +17,7 @@ test.describe('Swagger', () => { test('Create column', async () => { // access swagger link - const link = `http://localhost:8080//api/v1/db/meta/bases/${context.base.id}/swagger`; + const link = `http://localhost:8080/api/v1/db/meta/bases/${context.base.id}/swagger`; await dashboard.rootPage.goto(link); const swagger = dashboard.rootPage;