Browse Source

refactor: remove extra `/`

pull/6644/head
Pranav C 12 months ago
parent
commit
d30c4d0c95
  1. 2
      packages/nocodb/src/controllers/auth/ui/auth/emailVerify.ts
  2. 4
      packages/nocodb/tests/unit/factory/column.ts
  3. 10
      packages/nocodb/tests/unit/factory/view.ts
  4. 2
      tests/playwright/pages/Dashboard/ShareProjectButton/index.ts
  5. 2
      tests/playwright/pages/Dashboard/Sidebar/index.ts
  6. 4
      tests/playwright/pages/Dashboard/TreeView.ts
  7. 2
      tests/playwright/pages/Dashboard/ViewSidebar/index.ts
  8. 4
      tests/playwright/pages/Dashboard/common/Toolbar/Filter.ts
  9. 2
      tests/playwright/pages/ProjectsPage/index.ts

2
packages/nocodb/src/controllers/auth/ui/auth/emailVerify.ts

@ -53,7 +53,7 @@ export default `<!DOCTYPE html>
methods: {},
async created() {
try {
const valid = (await axios.post('<%- baseUrl %>//api/v1/db/auth/email/validate/' + this.token)).data;
const valid = (await axios.post('<%- baseUrl %>/api/v1/db/auth/email/validate/' + this.token)).data;
this.valid = !!valid;
} catch (e) {
this.valid = false;

4
packages/nocodb/tests/unit/factory/column.ts

@ -164,7 +164,7 @@ const customColumns = function (type: string, options: any = {}) {
const createColumn = async (context, table, columnAttr) => {
await request(context.app)
.post(`//api/v1/db/meta/tables/${table.id}/columns`)
.post(`/api/v1/db/meta/tables/${table.id}/columns`)
.set('xc-auth', context.token)
.send({
...columnAttr,
@ -373,7 +373,7 @@ const updateViewColumn = async (
{ view, column, attr }: { column: Column; view: View; attr: any },
) => {
const res = await request(context.app)
.patch(`//api/v1/db/meta/views/${view.id}/columns/${column.id}`)
.patch(`/api/v1/db/meta/views/${view.id}/columns/${column.id}`)
.set('xc-auth', context.token)
.send({
...attr,

10
packages/nocodb/tests/unit/factory/view.ts

@ -31,7 +31,7 @@ const createView = async (
};
const response = await request(context.app)
.post(`//api/v1/db/meta/tables/${table.id}/${viewTypeStr(type)}`)
.post(`/api/v1/db/meta/tables/${table.id}/${viewTypeStr(type)}`)
.set('xc-auth', context.token)
.send({
title,
@ -53,7 +53,7 @@ const getView = async (
{ table, name }: { table: Model; name: string },
) => {
const response = await request(context.app)
.get(`//api/v1/db/meta/tables/${table.id}/views`)
.get(`/api/v1/db/meta/tables/${table.id}/views`)
.set('xc-auth', context.token);
if (response.status !== 200) {
throw new Error('List Views', response.body.message);
@ -85,7 +85,7 @@ const updateView = async (
if (filter.length) {
for (let i = 0; i < filter.length; i++) {
await request(context.app)
.post(`//api/v1/db/meta/views/${view.id}/filters`)
.post(`/api/v1/db/meta/views/${view.id}/filters`)
.set('xc-auth', context.token)
.send(filter[i])
.expect(200);
@ -95,7 +95,7 @@ const updateView = async (
if (sort.length) {
for (let i = 0; i < sort.length; i++) {
await request(context.app)
.post(`//api/v1/db/meta/views/${view.id}/sorts`)
.post(`/api/v1/db/meta/views/${view.id}/sorts`)
.set('xc-auth', context.token)
.send(sort[i])
.expect(200);
@ -113,7 +113,7 @@ const updateView = async (
).id;
// configure view to hide selected fields
await request(context.app)
.patch(`//api/v1/db/meta/views/${view.id}/columns/${viewColumnId}`)
.patch(`/api/v1/db/meta/views/${view.id}/columns/${viewColumnId}`)
.set('xc-auth', context.token)
.send({ show: false })
.expect(200);

2
tests/playwright/pages/Dashboard/ShareProjectButton/index.ts

@ -108,7 +108,7 @@ export class ShareProjectButtonPage extends BasePage {
await this.waitForResponse({
uiAction: () => this.rootPage.getByTestId('docs-base-share-public-toggle').click(),
httpMethodsToMatch: ['PATCH'],
requestUrlPathToMatch: `//api/v1/db/meta/projects`,
requestUrlPathToMatch: `/api/v1/db/meta/projects`,
});
}

2
tests/playwright/pages/Dashboard/Sidebar/index.ts

@ -121,7 +121,7 @@ export class SidebarPage extends BasePage {
this.rootPage.locator('.ant-modal-content').locator('button.ant-btn.ant-btn-primary').click();
await this.waitForResponse({
httpMethodsToMatch: ['POST'],
requestUrlPathToMatch: '//api/v1/db/meta/tables/',
requestUrlPathToMatch: '/api/v1/db/meta/tables/',
uiAction: submitAction,
responseJsonMatcher: json => json.title === title,
});

4
tests/playwright/pages/Dashboard/TreeView.ts

@ -179,7 +179,7 @@ export class TreeViewPage extends BasePage {
return await this.dashboard.get().locator('button:has-text("Delete Table")').click();
},
httpMethodsToMatch: ['DELETE'],
requestUrlPathToMatch: `//api/v1/db/meta/tables/`,
requestUrlPathToMatch: `/api/v1/db/meta/tables/`,
});
await (await this.rootPage.locator('.nc-container').last().elementHandle())?.waitForElementState('stable');
@ -253,7 +253,7 @@ export class TreeViewPage extends BasePage {
await this.waitForResponse({
uiAction: async () => await this.rootPage.getByRole('button', { name: 'Confirm' }).click(),
httpMethodsToMatch: ['POST'],
requestUrlPathToMatch: `//api/v1/db/meta/duplicate/`,
requestUrlPathToMatch: `/api/v1/db/meta/duplicate/`,
});
await this.get().locator(`[data-testid="nc-tbl-title-${title} copy"]`).waitFor();
}

2
tests/playwright/pages/Dashboard/ViewSidebar/index.ts

@ -163,7 +163,7 @@ export class ViewSidebarPage extends BasePage {
this.rootPage.locator('.ant-modal-content').locator('button:has-text("Create a View"):visible').click();
await this.waitForResponse({
httpMethodsToMatch: ['POST'],
requestUrlPathToMatch: '//api/v1/db/meta/tables/',
requestUrlPathToMatch: '/api/v1/db/meta/tables/',
uiAction: submitAction,
});
// await this.verifyToast({ message: 'View created successfully' });

4
tests/playwright/pages/Dashboard/common/Toolbar/Filter.ts

@ -351,7 +351,7 @@ export class ToolbarFilterPage extends BasePage {
await this.waitForResponse({
uiAction: async () => await this.get().locator('.nc-filter-item-remove-btn').click(),
httpMethodsToMatch: ['DELETE'],
requestUrlPathToMatch: '//api/v1/db/meta/filters/',
requestUrlPathToMatch: '/api/v1/db/meta/filters/',
});
} else {
await this.get().locator('.nc-filter-item-remove-btn').click();
@ -367,7 +367,7 @@ export class ToolbarFilterPage extends BasePage {
await this.waitForResponse({
uiAction: async () => await this.get().locator('.nc-filter-item-remove-btn').click(),
httpMethodsToMatch: ['DELETE'],
requestUrlPathToMatch: '//api/v1/db/meta/filters/',
requestUrlPathToMatch: '/api/v1/db/meta/filters/',
});
} else {
await this.get().locator('.nc-filter-item-remove-btn').click();

2
tests/playwright/pages/ProjectsPage/index.ts

@ -103,7 +103,7 @@ export class ProjectsPage extends BasePage {
const reloadUiAction = () => this.get().locator('[data-testid="bases-reload-button"]').click();
await this.waitForResponse({
uiAction: reloadUiAction,
requestUrlPathToMatch: '//api/v1/db/meta/projects',
requestUrlPathToMatch: '/api/v1/db/meta/projects',
httpMethodsToMatch: ['GET'],
});
}

Loading…
Cancel
Save