Update selector to test SVG icon name
This commit is contained in:
parent
bed16f4828
commit
978900333b
1 changed files with 3 additions and 7 deletions
|
@ -16,24 +16,20 @@ describe('ItemCaretComponent', () => {
|
||||||
describe('template', () => {
|
describe('template', () => {
|
||||||
it('should render component template correctly', () => {
|
it('should render component template correctly', () => {
|
||||||
const vm = createComponent();
|
const vm = createComponent();
|
||||||
vm.$mount();
|
|
||||||
expect(vm.$el.classList.contains('folder-caret')).toBeTruthy();
|
expect(vm.$el.classList.contains('folder-caret')).toBeTruthy();
|
||||||
|
expect(vm.$el.querySelectorAll('svg').length).toBe(1);
|
||||||
vm.$destroy();
|
vm.$destroy();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render caret down icon if `isGroupOpen` prop is `true`', () => {
|
it('should render caret down icon if `isGroupOpen` prop is `true`', () => {
|
||||||
const vm = createComponent(true);
|
const vm = createComponent(true);
|
||||||
vm.$mount();
|
expect(vm.$el.querySelector('svg use').getAttribute('xlink:href')).toContain('angle-down');
|
||||||
expect(vm.$el.querySelectorAll('i.fa.fa-caret-down').length).toBe(1);
|
|
||||||
expect(vm.$el.querySelectorAll('i.fa.fa-caret-right').length).toBe(0);
|
|
||||||
vm.$destroy();
|
vm.$destroy();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should render caret right icon if `isGroupOpen` prop is `false`', () => {
|
it('should render caret right icon if `isGroupOpen` prop is `false`', () => {
|
||||||
const vm = createComponent();
|
const vm = createComponent();
|
||||||
vm.$mount();
|
expect(vm.$el.querySelector('svg use').getAttribute('xlink:href')).toContain('angle-right');
|
||||||
expect(vm.$el.querySelectorAll('i.fa.fa-caret-down').length).toBe(0);
|
|
||||||
expect(vm.$el.querySelectorAll('i.fa.fa-caret-right').length).toBe(1);
|
|
||||||
vm.$destroy();
|
vm.$destroy();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue