mirror of
https://github.com/baserow/baserow.git
synced 2026-12-05 16:58:36 +00:00
44 lines
1.3 KiB
JavaScript
44 lines
1.3 KiB
JavaScript
import { mount } from '@vue/test-utils'
|
|
|
|
import WidgetBoard from '@baserow/modules/dashboard/components/WidgetBoard'
|
|
|
|
describe('WidgetBoard', () => {
|
|
test('renders a loader instead of widgets in its ClientOnly fallback', () => {
|
|
const wrapper = mount(WidgetBoard, {
|
|
props: {
|
|
dashboard: { workspace: { id: 1 } },
|
|
},
|
|
global: {
|
|
mocks: {
|
|
$store: {
|
|
getters: {
|
|
'dashboardApplication/getWidgets': [{ id: 1, title: 'Summary' }],
|
|
},
|
|
},
|
|
},
|
|
stubs: {
|
|
ClientOnly: {
|
|
template: '<div><slot name="fallback" /></div>',
|
|
},
|
|
DashboardWidgetGridLoading: {
|
|
template: '<div data-testid="dashboard-widget-grid-loading"></div>',
|
|
},
|
|
DashboardWidget: {
|
|
props: ['widget'],
|
|
template:
|
|
'<article class="dashboard-widget-stub">{{ widget.title }}</article>',
|
|
},
|
|
},
|
|
},
|
|
})
|
|
|
|
expect(
|
|
wrapper.find('[data-testid="dashboard-widget-board-fallback"]').exists()
|
|
).toBe(true)
|
|
expect(
|
|
wrapper.find('[data-testid="dashboard-widget-grid-loading"]').exists()
|
|
).toBe(true)
|
|
expect(wrapper.find('.dashboard-widget-stub').exists()).toBe(false)
|
|
})
|
|
})
|