Skip to content

Commit

Permalink
filter list component tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aotearoan committed Jan 30, 2021
1 parent 6eb3a21 commit afae148
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@aotearoan/neon",
"description": "Neon is a lightweight design library of VueJS components with minimal dependencies. It supports light and dark modes and can be extended to support multiple themes",
"version": "4.1.16",
"version": "4.1.17",
"main": "dist/@aotearoan/neon.umd.js",
"types": "dist/@aotearoan/components.d.ts",
"files": [
Expand Down
21 changes: 21 additions & 0 deletions src/components/user-input/filter-list/NeonFilterList.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,27 @@ describe('NeonFilterList', () => {
expect(el.attributes().tabindex).toEqual('0');
});

it('renders show more label', () => {
const showMoreLabel = 'xdd';
const wrapper = mount(NeonFilterList, {
propsData: { items, value: [], displayCount: 2, showMoreLabel },
});
expect(wrapper.find('.neon-filter-list__show-toggle').text()).toEqual(showMoreLabel);
});

it('renders show less label', (done) => {
const showLessLabel = 'xdd';
const showMoreLabel = 'show more';
const wrapper = mount(NeonFilterList, {
propsData: { items, value: [], displayCount: 2, showMoreLabel, showLessLabel },
});
wrapper.find('.neon-filter-list__show-toggle').trigger('click');
setTimeout(() => {
expect(wrapper.find('.neon-filter-list__show-toggle').text()).toEqual(showLessLabel);
done();
});
});

it('emits input on click multiple', () => {
const wrapper = mount(NeonFilterList, {
propsData: { items, value: [items[1].key] },
Expand Down

0 comments on commit afae148

Please sign in to comment.