Files
Peter EvansandJeremie Pardou 95b892af41 feat: add automatic snapshot schedules (#6746)
* feat: add automatic snapshot schedules

* fix: show the count in relative date labels

* refactor: rename snapshot allowance setting to workspace

* feat: notify workspace admins when automatic snapshots fail

* feat: show the last automatic snapshot execution per application

* fix: simplify snapshot modal layout and capacity feedback

---------

Co-authored-by: Jeremie Pardou <571533+jrmi@users.noreply.github.com>
2026-11-24 14:12:03 +00:00

46 lines
1.4 KiB
JavaScript

import { shallowMount } from '@vue/test-utils'
import Alert from '@baserow/modules/core/components/Alert'
describe('Alert.vue', () => {
it('renders the alert title and message', () => {
const title = 'This is an alert title.'
const message = 'This is an alert message.'
const wrapper = shallowMount(Alert, {
slots: {
title,
default: message,
},
})
expect(wrapper.find('.alert__title').text()).toMatch('title')
expect(wrapper.find('.alert__message').text()).toMatch(message)
})
it('emits the close event when the close button is clicked', () => {
const closeButton = true
const wrapper = shallowMount(Alert, {
propsData: { closeButton },
})
wrapper.find('.alert__close').trigger('click')
expect(wrapper.emitted().close).toBeTruthy()
})
it('sets the alert type based on the type prop', () => {
const type = 'success'
const wrapper = shallowMount(Alert, {
propsData: { type },
})
expect(wrapper.classes()).toContain(`alert--${type}`)
})
it.each(['default', 'compact'])(
'renders an error using the %s appearance',
(appearance) => {
const wrapper = shallowMount(Alert, {
props: { type: 'error', appearance },
slots: { default: 'There is not enough room for a new snapshot.' },
})
expect(wrapper.html()).toMatchSnapshot()
}
)
})