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

View File

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