From 9fe8a8c68720154ff04e27d8218308431a6191e6 Mon Sep 17 00:00:00 2001 From: Mitch-Budibase Date: Fri, 21 Jan 2022 13:12:16 +0000 Subject: [PATCH] lint changes --- .gitignore | 1 + .../cypress/integration/createScreen.js | 4 +-- .../builder/cypress/support/filterTests.js | 28 +++++++++---------- packages/server/src/integrations/utils.ts | 23 +++++++++++---- 4 files changed, 35 insertions(+), 21 deletions(-) diff --git a/.gitignore b/.gitignore index 6ba2f61ed7..969a38b46e 100644 --- a/.gitignore +++ b/.gitignore @@ -95,3 +95,4 @@ hosting/.generated-envoy.dev.yaml *.sublime-workspace bin/ +packages/builder/cypress.env.json diff --git a/packages/builder/cypress/integration/createScreen.js b/packages/builder/cypress/integration/createScreen.js index 8dbe2a1304..ada68d82dc 100644 --- a/packages/builder/cypress/integration/createScreen.js +++ b/packages/builder/cypress/integration/createScreen.js @@ -1,6 +1,6 @@ import filterTests from "../support/filterTests" -filterTests(['smoke', 'all'], () => { +filterTests(["smoke", "all"], () => { context("Screen Tests", () => { before(() => { cy.login() @@ -21,5 +21,5 @@ filterTests(['smoke', 'all'], () => { cy.contains("/test-with-spaces").should("exist") }) }) - }) + }) }) diff --git a/packages/builder/cypress/support/filterTests.js b/packages/builder/cypress/support/filterTests.js index 978103ea8d..074fd05d33 100644 --- a/packages/builder/cypress/support/filterTests.js +++ b/packages/builder/cypress/support/filterTests.js @@ -1,16 +1,16 @@ const filterTests = (testTags, runTest) => { - // testTags is an array of tags - // runTest is all tests - if (Cypress.env('TEST_TAGS')) { - const tags = Cypress.env('TEST_TAGS').split('/'); - const found = testTags.some(($testTags) => tags.includes($testTags)); - - if (found) { - runTest(); - } - } else { - runTest(); + // testTags is an array of tags + // runTest is all tests + if (Cypress.env("TEST_TAGS")) { + const tags = Cypress.env("TEST_TAGS").split("/") + const found = testTags.some($testTags => tags.includes($testTags)) + + if (found) { + runTest() } - }; - - export default filterTests; \ No newline at end of file + } else { + runTest() + } +} + +export default filterTests diff --git a/packages/server/src/integrations/utils.ts b/packages/server/src/integrations/utils.ts index b8c96efffe..b9e643e26a 100644 --- a/packages/server/src/integrations/utils.ts +++ b/packages/server/src/integrations/utils.ts @@ -153,8 +153,15 @@ export function isIsoDateString(str: string) { * @param column The column to check, to see if it is a valid relationship. * @param tableIds The IDs of the tables which currently exist. */ -function shouldCopyRelationship(column: { type: string, tableId?: string }, tableIds: [string]) { - return column.type === FieldTypes.LINK && column.tableId && tableIds.includes(column.tableId) +function shouldCopyRelationship( + column: { type: string; tableId?: string }, + tableIds: [string] +) { + return ( + column.type === FieldTypes.LINK && + column.tableId && + tableIds.includes(column.tableId) + ) } /** @@ -165,9 +172,15 @@ function shouldCopyRelationship(column: { type: string, tableId?: string }, tabl * @param column The column to check for options or boolean type. * @param fetchedColumn The fetched column to check for the type in the external database. */ -function shouldCopySpecialColumn(column: { type: string }, fetchedColumn: { type: string } | undefined) { - return column.type === FieldTypes.OPTIONS || - ((!fetchedColumn || fetchedColumn.type === FieldTypes.NUMBER) && column.type === FieldTypes.BOOLEAN) +function shouldCopySpecialColumn( + column: { type: string }, + fetchedColumn: { type: string } | undefined +) { + return ( + column.type === FieldTypes.OPTIONS || + ((!fetchedColumn || fetchedColumn.type === FieldTypes.NUMBER) && + column.type === FieldTypes.BOOLEAN) + ) } /**