1
0
mirror of https://gitlab.com/bramw/baserow.git synced 2024-11-21 23:37:55 +00:00
bramw_baserow/web-frontend/test/fixtures/applications.js

23 lines
495 B
JavaScript

export function createApplication(
mock,
{ applicationId = 1, workspaceId = 1, tables = [] }
) {
const application = {
id: applicationId,
name: 'Test Database App',
order: applicationId,
type: 'database',
workspace: {
id: workspaceId,
name: 'Test workspace',
},
tables: tables.map((t) => ({
...t,
count: t.id,
database_id: applicationId,
})),
}
mock.onGet('/applications/').reply(200, [application])
return application
}