mirror of
https://github.com/baserow/baserow.git
synced 2026-12-05 00:38:35 +00:00
* WIP * Remove formula conversion related changes * Move the file input click guard to formatted text component * Move format types into their own components * Use a shared markdown-it instance * Move the formatter into data explorer * Move minification logic into BaserowFormulaMinified * Renderer should own the root element * Ensure long choice names are truncated * Ensure line height doesn't grow for paragraphs * Add tests * Add changelog * Add specific tests for choice element
45 lines
1.1 KiB
JavaScript
45 lines
1.1 KiB
JavaScript
import { TestApp } from '@baserow/test/helpers/testApp'
|
|
|
|
describe('builderToast store', () => {
|
|
let testApp = null
|
|
let store = null
|
|
|
|
beforeEach(() => {
|
|
testApp = new TestApp()
|
|
store = testApp.store
|
|
})
|
|
|
|
afterEach(async () => {
|
|
await testApp.afterEach()
|
|
})
|
|
|
|
test('info keeps the formats of the title and message on the toast', async () => {
|
|
await store.dispatch('builderToast/info', {
|
|
title: '**Saved**',
|
|
titleFormat: 'markdown',
|
|
message: 'Row created',
|
|
messageFormat: 'markdown',
|
|
})
|
|
|
|
const [toast] = store.getters['builderToast/all']
|
|
expect(toast).toMatchObject({
|
|
type: 'info-primary',
|
|
title: '**Saved**',
|
|
titleFormat: 'markdown',
|
|
message: 'Row created',
|
|
messageFormat: 'markdown',
|
|
})
|
|
})
|
|
|
|
test('info leaves the formats out when none are given', async () => {
|
|
await store.dispatch('builderToast/info', {
|
|
title: 'Saved',
|
|
message: 'Row created',
|
|
})
|
|
|
|
const [toast] = store.getters['builderToast/all']
|
|
expect(toast).not.toHaveProperty('titleFormat')
|
|
expect(toast).not.toHaveProperty('messageFormat')
|
|
})
|
|
})
|