Files
baserow/web-frontend/test/unit/database/components/table/tableViewsContextEvents.spec.js
Davide Silvestri 7c97626046 fix: stop the guided tour from crashing when its steps change (#6942)
* 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
2026-12-02 10:33:35 +01:00

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()
})
})