1
0
Fork 0
mirror of synced 2024-06-18 18:35:37 +12:00

lint changes

This commit is contained in:
Mitch-Budibase 2022-01-21 13:12:16 +00:00
parent 7e834f3aa5
commit 9fe8a8c687
4 changed files with 35 additions and 21 deletions

1
.gitignore vendored
View file

@ -95,3 +95,4 @@ hosting/.generated-envoy.dev.yaml
*.sublime-workspace *.sublime-workspace
bin/ bin/
packages/builder/cypress.env.json

View file

@ -1,6 +1,6 @@
import filterTests from "../support/filterTests" import filterTests from "../support/filterTests"
filterTests(['smoke', 'all'], () => { filterTests(["smoke", "all"], () => {
context("Screen Tests", () => { context("Screen Tests", () => {
before(() => { before(() => {
cy.login() cy.login()
@ -21,5 +21,5 @@ filterTests(['smoke', 'all'], () => {
cy.contains("/test-with-spaces").should("exist") cy.contains("/test-with-spaces").should("exist")
}) })
}) })
}) })
}) })

View file

@ -1,16 +1,16 @@
const filterTests = (testTags, runTest) => { const filterTests = (testTags, runTest) => {
// testTags is an array of tags // testTags is an array of tags
// runTest is all tests // runTest is all tests
if (Cypress.env('TEST_TAGS')) { if (Cypress.env("TEST_TAGS")) {
const tags = Cypress.env('TEST_TAGS').split('/'); const tags = Cypress.env("TEST_TAGS").split("/")
const found = testTags.some(($testTags) => tags.includes($testTags)); const found = testTags.some($testTags => tags.includes($testTags))
if (found) { if (found) {
runTest(); runTest()
}
} else {
runTest();
} }
}; } else {
runTest()
export default filterTests; }
}
export default filterTests

View file

@ -153,8 +153,15 @@ export function isIsoDateString(str: string) {
* @param column The column to check, to see if it is a valid relationship. * @param column The column to check, to see if it is a valid relationship.
* @param tableIds The IDs of the tables which currently exist. * @param tableIds The IDs of the tables which currently exist.
*/ */
function shouldCopyRelationship(column: { type: string, tableId?: string }, tableIds: [string]) { function shouldCopyRelationship(
return column.type === FieldTypes.LINK && column.tableId && tableIds.includes(column.tableId) 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 column The column to check for options or boolean type.
* @param fetchedColumn The fetched column to check for the type in the external database. * @param fetchedColumn The fetched column to check for the type in the external database.
*/ */
function shouldCopySpecialColumn(column: { type: string }, fetchedColumn: { type: string } | undefined) { function shouldCopySpecialColumn(
return column.type === FieldTypes.OPTIONS || column: { type: string },
((!fetchedColumn || fetchedColumn.type === FieldTypes.NUMBER) && column.type === FieldTypes.BOOLEAN) fetchedColumn: { type: string } | undefined
) {
return (
column.type === FieldTypes.OPTIONS ||
((!fetchedColumn || fetchedColumn.type === FieldTypes.NUMBER) &&
column.type === FieldTypes.BOOLEAN)
)
} }
/** /**