Skip to content

Commit cd4117d

Browse files
committed
test: add test cases for largeAndBelow breakpoint
1 parent c3fdb12 commit cd4117d

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

src/HideAt.spec.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,4 +126,22 @@ describe('<HideAt />', () => {
126126
));
127127
assert.deepStrictEqual($.children().exists(), false);
128128
});
129+
130+
it('hides its children if breakpoint is largeAndBelow and currentBreakpoint is medium', () => {
131+
const $ = mount((
132+
<HideAt breakpoint="largeAndBelow" currentBreakpoint="medium">
133+
<div>Hello</div>
134+
</HideAt>
135+
));
136+
assert.deepStrictEqual($.children().exists(), false);
137+
});
138+
139+
it('hides its children if breakpoint is largeAndBelow and currentBreakpoint is small', () => {
140+
const $ = mount((
141+
<HideAt breakpoint="largeAndBelow" currentBreakpoint="small">
142+
<div>Hello</div>
143+
</HideAt>
144+
));
145+
assert.deepStrictEqual($.children().exists(), false);
146+
});
129147
});

src/ShowAt.spec.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,4 +117,22 @@ describe('<ShowAt />', () => {
117117
));
118118
assert.deepStrictEqual($.children().exists(), true);
119119
});
120+
121+
it('shows its children if breakpoint is largeAndBelow and currentBreakpoint is medium', () => {
122+
const $ = mount((
123+
<ShowAt breakpoint="largeAndBelow" currentBreakpoint="medium">
124+
<div>Hello</div>
125+
</ShowAt>
126+
));
127+
assert.deepStrictEqual($.children().exists(), true);
128+
});
129+
130+
it('shows its children if breakpoint is largeAndBelow and currentBreakpoint is small', () => {
131+
const $ = mount((
132+
<ShowAt breakpoint="largeAndBelow" currentBreakpoint="small">
133+
<div>Hello</div>
134+
</ShowAt>
135+
));
136+
assert.deepStrictEqual($.children().exists(), true);
137+
});
120138
});

0 commit comments

Comments
 (0)