1
0
Fork 0
mirror of synced 2024-07-15 03:05:57 +12:00

Use api calls for createExternalTable test helper

This commit is contained in:
Adria Navarro 2024-01-26 10:52:35 +01:00
parent 0efe0bb7ac
commit a555734519

View file

@ -618,7 +618,7 @@ class TestConfiguration {
async createExternalTable(
config?: TableToBuild,
options = { skipReassigning: false }
) {
): Promise<Table> {
if (config != null && config._id) {
delete config._id
}
@ -627,7 +627,16 @@ class TestConfiguration {
config.sourceId = this.datasource._id
config.sourceType = TableSourceType.EXTERNAL
}
return this.updateTable(config, options)
const table = await this.api.table.create({
...config,
sourceType: config.sourceType || TableSourceType.INTERNAL,
sourceId: config.sourceId || INTERNAL_TABLE_SOURCE_ID,
})
if (!options.skipReassigning) {
this.table = table
}
return table
}
async getTable(tableId?: string) {