mirror of
https://github.com/baserow/baserow.git
synced 2026-12-04 08:18:42 +00:00
* fix: stop the guided tour from crashing when its steps change Fixes #6941 * fix: re-prepare the guided tour step when the step at its index changes
48 lines
1.2 KiB
JavaScript
48 lines
1.2 KiB
JavaScript
import { TestApp } from '@baserow/test/helpers/testApp'
|
|
import Table from '@baserow/modules/database/components/table/Table'
|
|
|
|
describe('Table views context events', () => {
|
|
let testApp = null
|
|
|
|
beforeEach(() => {
|
|
testApp = new TestApp()
|
|
})
|
|
|
|
afterEach(async () => {
|
|
vi.restoreAllMocks()
|
|
await testApp.afterEach()
|
|
})
|
|
|
|
test('are ignored while the views are not loaded', async () => {
|
|
vi.spyOn(Table.methods, 'refresh').mockResolvedValue()
|
|
const view = {
|
|
id: 1,
|
|
type: 'grid',
|
|
ownership_type: 'collaborative',
|
|
filter_type: 'AND',
|
|
filters_disabled: false,
|
|
filters: [],
|
|
filter_groups: [],
|
|
sortings: [],
|
|
group_bys: [],
|
|
_: { type: testApp.store.$registry.get('view', 'grid').serialize() },
|
|
}
|
|
const wrapper = await testApp.mount(Table, {
|
|
props: {
|
|
database: { id: 1, workspace: { id: 1 } },
|
|
table: { id: 1 },
|
|
fields: [],
|
|
views: null,
|
|
view,
|
|
tableLoading: true,
|
|
readOnly: true,
|
|
},
|
|
})
|
|
|
|
expect(() => {
|
|
wrapper.vm.$bus.$emit('open-table-views-context')
|
|
wrapper.vm.$bus.$emit('close-table-views-context')
|
|
}).not.toThrow()
|
|
})
|
|
})
|