@drinksandco/celler
Advanced tools
Comparing version 1.34.1 to 1.34.2
{ | ||
"name": "@drinksandco/celler", | ||
"version": "1.34.1", | ||
"version": "1.34.2", | ||
"private": false, | ||
@@ -5,0 +5,0 @@ "main": "dist/celler.umd.js", |
@@ -33,2 +33,33 @@ import { render } from '@testing-library/vue' | ||
test('renders slot', () => { | ||
const customOptions = { | ||
props: { | ||
type: 'ok', | ||
messages, | ||
}, | ||
slots: { | ||
default: '<a data-testid="custom-slot">Click here</a>', | ||
}, | ||
} | ||
const { queryByText } = render(DcSystemMessage, customOptions) | ||
expect(queryByText('Click here')).toBeInTheDocument() | ||
expect(queryByText(/First message/i)).not.toBeInTheDocument() | ||
}) | ||
test("doesn't render message if custom slot is passed", () => { | ||
const customOptions = { | ||
props: { | ||
type: 'ok', | ||
messages, | ||
}, | ||
slots: { | ||
default: '<a data-testid="custom-slot">Click here</a>', | ||
}, | ||
} | ||
const { queryByText } = render(DcSystemMessage, customOptions) | ||
expect(queryByText(/First message/i)).not.toBeInTheDocument() | ||
}) | ||
test('renders icon', () => { | ||
@@ -35,0 +66,0 @@ const { queryByRole } = render(DcSystemMessage, options) |
@@ -121,1 +121,14 @@ import { storiesOf } from '@storybook/vue' | ||
})) | ||
.add('Custom', () => ({ | ||
components: { | ||
DcSystemMessage, | ||
}, | ||
template: ` | ||
<dc-system-message type="ok" :messages="['Puedes añadir 2 botellas más.']"> | ||
<span> | ||
This is a custom message. <a href="#">Click here.</a> | ||
</span> | ||
</dc-system-message> | ||
`, | ||
})) |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
6271792
57034