Skip to content

Commit 859c893

Browse files
committed
feat(@clayui/vertical-nav): LPD-46396 - Update tests and snapshots
1 parent 2fc9c3d commit 859c893

File tree

4 files changed

+35
-7
lines changed

4 files changed

+35
-7
lines changed

packages/clay-core/src/vertical-nav/__tests__/BasicRendering.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ describe('VerticalNav basic rendering', () => {
1313

1414
it('render static content', () => {
1515
const {container} = render(
16-
<VerticalNav>
16+
<VerticalNav aria-label="vertical navbar">
1717
<VerticalNav.Item active key="home">
1818
Home
1919
</VerticalNav.Item>
@@ -28,6 +28,7 @@ describe('VerticalNav basic rendering', () => {
2828
it('render dynamic content', () => {
2929
const {container} = render(
3030
<VerticalNav
31+
aria-label="vertical navbar"
3132
items={[
3233
{
3334
id: 1,

packages/clay-core/src/vertical-nav/__tests__/__snapshots__/BasicRendering.tsx.snap

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
exports[`VerticalNav basic rendering render dynamic content 1`] = `
44
<div>
55
<nav
6+
aria-label="vertical navbar"
67
class="menubar menubar-transparent menubar-vertical-expand-md"
78
>
89
<button
@@ -107,6 +108,7 @@ exports[`VerticalNav basic rendering render dynamic content 1`] = `
107108
exports[`VerticalNav basic rendering render static content 1`] = `
108109
<div>
109110
<nav
111+
aria-label="vertical navbar"
110112
class="menubar menubar-transparent menubar-vertical-expand-md"
111113
>
112114
<button

packages/clay-nav/src/__tests__/__snapshots__/index.tsx.snap

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
exports[`ClayVerticalNav renders 1`] = `
44
<div>
55
<nav
6+
aria-label="vertical navbar"
67
class="menubar menubar-transparent menubar-vertical-expand-md"
78
>
89
<button

packages/clay-nav/src/__tests__/index.tsx

+30-6
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,23 @@ describe('ClayVerticalNav', () => {
6464

6565
it('renders', () => {
6666
const {container} = render(
67-
<ClayVerticalNav items={items} spritemap="/path/to" />
67+
<ClayVerticalNav
68+
aria-label="vertical navbar"
69+
items={items}
70+
spritemap="/path/to"
71+
/>
6872
);
6973

7074
expect(container).toMatchSnapshot();
7175
});
7276

7377
it('expands items when clicked', () => {
7478
const {container, getByText} = render(
75-
<ClayVerticalNav items={items} spritemap="/path/to" />
79+
<ClayVerticalNav
80+
aria-label="vertical navbar"
81+
items={items}
82+
spritemap="/path/to"
83+
/>
7684
);
7785

7886
expect(
@@ -88,7 +96,11 @@ describe('ClayVerticalNav', () => {
8896

8997
it('expand items by pressing the right arrow key', () => {
9098
const {getByText} = render(
91-
<ClayVerticalNav items={ITEMS} spritemap="/path/to" />
99+
<ClayVerticalNav
100+
aria-label="vertical navbar"
101+
items={ITEMS}
102+
spritemap="/path/to"
103+
/>
92104
);
93105

94106
const projects = getByText('Projects');
@@ -105,7 +117,11 @@ describe('ClayVerticalNav', () => {
105117

106118
it('collapse items by pressing the left arrow key', () => {
107119
const {getByText} = render(
108-
<ClayVerticalNav items={ITEMS} spritemap="/path/to" />
120+
<ClayVerticalNav
121+
aria-label="vertical navbar"
122+
items={ITEMS}
123+
spritemap="/path/to"
124+
/>
109125
);
110126

111127
const projects = getByText('Projects');
@@ -126,7 +142,11 @@ describe('ClayVerticalNav', () => {
126142

127143
it('moves focus to first item if item is expanded', () => {
128144
const {getByText} = render(
129-
<ClayVerticalNav items={ITEMS} spritemap="/path/to" />
145+
<ClayVerticalNav
146+
aria-label="vertical navbar"
147+
items={ITEMS}
148+
spritemap="/path/to"
149+
/>
130150
);
131151

132152
const projects = getByText('Projects');
@@ -149,7 +169,11 @@ describe('ClayVerticalNav', () => {
149169

150170
it('move focus to parent if focus is on child when pressing left arrow key', () => {
151171
const {getByText} = render(
152-
<ClayVerticalNav items={ITEMS} spritemap="/path/to" />
172+
<ClayVerticalNav
173+
aria-label="vertical navbar"
174+
items={ITEMS}
175+
spritemap="/path/to"
176+
/>
153177
);
154178

155179
const projects = getByText('Projects');

0 commit comments

Comments
 (0)