diff --git a/packages/server/src/api/routes/tests/datasource.spec.ts b/packages/server/src/api/routes/tests/datasource.spec.ts index 0066be2a64..f5e31b6a1a 100644 --- a/packages/server/src/api/routes/tests/datasource.spec.ts +++ b/packages/server/src/api/routes/tests/datasource.spec.ts @@ -7,6 +7,7 @@ import sdk from "../../../sdk" import tk from "timekeeper" import { mocks } from "@budibase/backend-core/tests" import { QueryPreview, SourceName } from "@budibase/types" +import { DatabaseName, getDatasource } from "../../../integrations/tests/utils" tk.freeze(mocks.date.MOCK_DATE) @@ -223,4 +224,24 @@ describe("/datasources", () => { }) }) }) + + describe.only.each([ + [DatabaseName.POSTGRES, getDatasource(DatabaseName.POSTGRES)], + [DatabaseName.MYSQL, getDatasource(DatabaseName.MYSQL)], + [DatabaseName.SQL_SERVER, getDatasource(DatabaseName.SQL_SERVER)], + [DatabaseName.MARIADB, getDatasource(DatabaseName.MARIADB)], + ])("fetch schema (%s)", (_, dsProvider) => { + beforeAll(async () => { + datasource = await config.api.datasource.create(await dsProvider) + }) + + it("aa", async () => { + const datasourceId = datasource!._id! + const persisted = await config.api.datasource.get(datasourceId) + await config.api.datasource.fetchSchema(datasourceId) + + const updated = await config.api.datasource.get(datasourceId) + expect(updated).toEqual(persisted) + }) + }) }) diff --git a/packages/server/src/api/routes/tests/table.spec.ts b/packages/server/src/api/routes/tests/table.spec.ts index 77e05b8e07..019b392408 100644 --- a/packages/server/src/api/routes/tests/table.spec.ts +++ b/packages/server/src/api/routes/tests/table.spec.ts @@ -34,7 +34,7 @@ describe.each([ [DatabaseName.SQL_SERVER, getDatasource(DatabaseName.SQL_SERVER)], [DatabaseName.MARIADB, getDatasource(DatabaseName.MARIADB)], ])("/tables (%s)", (_, dsProvider) => { - let isInternal: boolean + const isInternal: boolean = !dsProvider let datasource: Datasource | undefined let config = setup.getConfig() @@ -44,9 +44,7 @@ describe.each([ await config.init() if (dsProvider) { datasource = await config.api.datasource.create(await dsProvider) - isInternal = false } else { - isInternal = true } })