This commit is contained in:
Adria Navarro 2024-01-26 10:57:35 +01:00
parent da9f367962
commit c0581e41d3
2 changed files with 6 additions and 6 deletions

View File

@ -12,7 +12,7 @@ let apiKey: string, table: Table, app: App, makeRequest: any
beforeAll(async () => {
app = await config.init()
table = await config.updateTable()
table = await config.upsertTable()
apiKey = await config.generateApiKey()
makeRequest = generateMakeRequest(apiKey)
})
@ -69,7 +69,7 @@ describe("check the applications endpoints", () => {
describe("check the tables endpoints", () => {
it("should allow retrieving tables through search", async () => {
await config.createApp("new app 1")
table = await config.updateTable()
table = await config.upsertTable()
const res = await makeRequest("post", "/tables/search")
expect(res).toSatisfyApiSpec()
})
@ -108,7 +108,7 @@ describe("check the tables endpoints", () => {
describe("check the rows endpoints", () => {
let row: Row
it("should allow retrieving rows through search", async () => {
table = await config.updateTable()
table = await config.upsertTable()
const res = await makeRequest("post", `/tables/${table._id}/rows/search`, {
query: {},
})

View File

@ -587,7 +587,7 @@ class TestConfiguration {
// TABLE
async updateTable(
async upsertTable(
config?: TableToBuild,
{ skipReassigning } = { skipReassigning: false }
): Promise<Table> {
@ -614,7 +614,7 @@ class TestConfiguration {
if (!config.sourceId) {
config.sourceId = INTERNAL_TABLE_SOURCE_ID
}
return this.updateTable(config, options)
return this.upsertTable(config, options)
}
async createExternalTable(
@ -629,7 +629,7 @@ class TestConfiguration {
config.sourceId = this.datasource._id
config.sourceType = TableSourceType.EXTERNAL
}
return this.updateTable(config, options)
return this.upsertTable(config, options)
}
async getTable(tableId?: string) {