Files
baserow/web-frontend/test/unit/builder/store/builderToast.spec.js
Tsering Paljor 674e4b12a8 feat: Add markdown support to more Builder elements (#6124)
* 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
2026-10-09 09:36:32 +04:00

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