@vtmn/svelte
Advanced tools
Comparing version 2.3.0 to 2.3.1
{ | ||
"name": "@vtmn/svelte", | ||
"version": "2.3.0", | ||
"version": "2.3.1", | ||
"description": "Decathlon Design System - Vitamin Svelte components library", | ||
@@ -35,3 +35,3 @@ "keywords": [ | ||
"dependencies": { | ||
"@vtmn/css": "^1.3.0", | ||
"@vtmn/css": "^1.3.1", | ||
"@vtmn/css-accordion": "^1.1.3", | ||
@@ -52,3 +52,3 @@ "@vtmn/css-alert": "^1.1.1", | ||
"@vtmn/css-modal": "^1.1.1", | ||
"@vtmn/css-navbar": "^1.3.0", | ||
"@vtmn/css-navbar": "^1.3.1", | ||
"@vtmn/css-popover": "^1.1.1", | ||
@@ -134,3 +134,3 @@ "@vtmn/css-price": "^1.1.1", | ||
}, | ||
"gitHead": "ba8d33a084f70231fc8049cb1da7e261db3b1101" | ||
"gitHead": "f7488a86edb2eec97a4425132d74486624e6bdf2" | ||
} |
import { render } from '@testing-library/svelte'; | ||
import VtmnNavbarLink from './VtmnNavbarLinkWithSlot.svelte'; | ||
import VtmnNavbarLink from '../VtmnNavbarLink.svelte'; | ||
@@ -11,6 +11,7 @@ describe('<VtmnNavbarLink />', () => { | ||
test('Renders correctly with icon, label', () => { | ||
test('Renders correctly with icon, label & showLabel = true', () => { | ||
const { container, getByText } = render(VtmnNavbarLink, { | ||
icon: 'question-line', | ||
label: 'Contact us', | ||
showLabel: true, | ||
}); | ||
@@ -20,2 +21,5 @@ | ||
expect( | ||
container.getElementsByClassName('vtmn-navbar_link--icon-alone').length, | ||
).toBe(0); | ||
expect( | ||
container.children[0].getElementsByClassName('vtmx-question-line').length, | ||
@@ -26,2 +30,20 @@ ).toBe(1); | ||
test('Renders correctly with icon, label & showLabel = false', () => { | ||
const { container, getByText } = render(VtmnNavbarLink, { | ||
icon: 'question-line', | ||
label: 'Contact us', | ||
showLabel: false, | ||
}); | ||
expect(container).toBeVisible(); | ||
expect( | ||
container.getElementsByClassName('vtmn-navbar_link--icon-alone').length, | ||
).toBe(1); | ||
expect( | ||
container.children[0].getElementsByClassName('vtmx-question-line').length, | ||
).toBe(1); | ||
expect(container.getElementsByClassName('vtmn-sr-only')[0]).toBeDefined(); | ||
expect(getByText('Contact us')).toBeDefined(); | ||
}); | ||
test('Can add custom css classes', () => { | ||
@@ -35,3 +57,3 @@ const { container } = render(VtmnNavbarLink, { | ||
test('Can have custom props', () => { | ||
test('Can have custom props', async () => { | ||
const { container } = render(VtmnNavbarLink, { id: 'test' }); | ||
@@ -41,11 +63,2 @@ | ||
}); | ||
test('Should display a badge', () => { | ||
const { container } = render(VtmnNavbarLink, { | ||
icon: 'question-line', | ||
label: 'Contact us', | ||
badgeValue: 3, | ||
}); | ||
expect(container.querySelector('span[class^="vtmn-badge"]')).toBeVisible(); | ||
}); | ||
}); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1521458
31903
156
Updated@vtmn/css@^1.3.1
Updated@vtmn/css-navbar@^1.3.1