-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12354 from Budibase/fix/12154-invalid-table-fetches
Fix issues with data UI loading some tables
- Loading branch information
Showing
9 changed files
with
88 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import TestConfig from "../../tests/utilities/TestConfiguration" | ||
import { basicTable } from "../../tests/utilities/structures" | ||
import { Table } from "@budibase/types" | ||
import sdk from "../" | ||
|
||
describe("tables", () => { | ||
const config = new TestConfig() | ||
let table: Table | ||
|
||
beforeAll(async () => { | ||
await config.init() | ||
table = await config.api.table.create(basicTable()) | ||
}) | ||
|
||
describe("getTables", () => { | ||
it("should be able to retrieve tables", async () => { | ||
await config.doInContext(config.appId, async () => { | ||
const tables = await sdk.tables.getTables([table._id!]) | ||
expect(tables.length).toBe(1) | ||
expect(tables[0]._id).toBe(table._id) | ||
expect(tables[0].name).toBe(table.name) | ||
}) | ||
}) | ||
|
||
it("shouldn't fail when retrieving tables that don't exist", async () => { | ||
await config.doInContext(config.appId, async () => { | ||
const tables = await sdk.tables.getTables(["unknown"]) | ||
expect(tables.length).toBe(0) | ||
}) | ||
}) | ||
|
||
it("should de-duplicate the IDs", async () => { | ||
await config.doInContext(config.appId, async () => { | ||
const tables = await sdk.tables.getTables([table._id!, table._id!]) | ||
expect(tables.length).toBe(1) | ||
}) | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters