@vtmn/svelte
Advanced tools
Comparing version 2.2.0 to 2.3.0
{ | ||
"name": "@vtmn/svelte", | ||
"version": "2.2.0", | ||
"version": "2.3.0", | ||
"description": "Decathlon Design System - Vitamin Svelte components library", | ||
@@ -35,3 +35,3 @@ "keywords": [ | ||
"dependencies": { | ||
"@vtmn/css": "^1.2.2", | ||
"@vtmn/css": "^1.3.0", | ||
"@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.2.0", | ||
"@vtmn/css-navbar": "^1.3.0", | ||
"@vtmn/css-popover": "^1.1.1", | ||
@@ -134,3 +134,3 @@ "@vtmn/css-price": "^1.1.1", | ||
}, | ||
"gitHead": "0b233d93de5269ae15b6c04f566162018709307d" | ||
"gitHead": "ba8d33a084f70231fc8049cb1da7e261db3b1101" | ||
} |
import { render } from '@testing-library/svelte'; | ||
import VtmnNavbarLink from '../VtmnNavbarLink.svelte'; | ||
import VtmnNavbarLink from './VtmnNavbarLinkWithSlot.svelte'; | ||
@@ -11,7 +11,6 @@ describe('<VtmnNavbarLink />', () => { | ||
test('Renders correctly with icon, label & showLabel = true', () => { | ||
test('Renders correctly with icon, label', () => { | ||
const { container, getByText } = render(VtmnNavbarLink, { | ||
icon: 'question-line', | ||
label: 'Contact us', | ||
showLabel: true, | ||
}); | ||
@@ -21,5 +20,2 @@ | ||
expect( | ||
container.getElementsByClassName('vtmn-navbar_link--icon-alone').length, | ||
).toBe(0); | ||
expect( | ||
container.children[0].getElementsByClassName('vtmx-question-line').length, | ||
@@ -30,20 +26,2 @@ ).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', () => { | ||
@@ -57,3 +35,3 @@ const { container } = render(VtmnNavbarLink, { | ||
test('Can have custom props', async () => { | ||
test('Can have custom props', () => { | ||
const { container } = render(VtmnNavbarLink, { id: 'test' }); | ||
@@ -63,2 +41,11 @@ | ||
}); | ||
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
157
1515405
31871
Updated@vtmn/css@^1.3.0
Updated@vtmn/css-navbar@^1.3.0