Commit 52b06250 authored by Alexander Turinske's avatar Alexander Turinske

Separate new tests from old tests

- the new tests use vue/test-utils and it was confusing to
  mix those tests in with existing ones, so I separated them
  out into their own describe block
parent 931a2c62
...@@ -163,6 +163,20 @@ describe('Report section', () => { ...@@ -163,6 +163,20 @@ describe('Report section', () => {
.catch(done.fail); .catch(done.fail);
}); });
it('is always expanded, if always-open is set to true', done => {
vm.alwaysOpen = true;
Vue.nextTick()
.then(() => {
expect(vm.$el.querySelector('.js-report-section-container')).not.toHaveCss(hiddenCss);
expect(vm.$el.querySelector('button')).toBeNull();
})
.then(done)
.catch(done.fail);
});
});
});
describe('snowplow events', () => {
it('does emit an event on issue toggle if the shouldEmitToggleEvent prop does exist', done => { it('does emit an event on issue toggle if the shouldEmitToggleEvent prop does exist', done => {
createComponent({ hasIssues: true, shouldEmitToggleEvent: true }); createComponent({ hasIssues: true, shouldEmitToggleEvent: true });
...@@ -193,22 +207,18 @@ describe('Report section', () => { ...@@ -193,22 +207,18 @@ describe('Report section', () => {
.catch(done.fail); .catch(done.fail);
}); });
it('is always expanded, if always-open is set to true', done => { it('does not emit an event if always-open is set to true', done => {
createComponent({ alwaysOpen: true, hasIssues: true, shouldEmitToggleEvent: true }); createComponent({ alwaysOpen: true, hasIssues: true, shouldEmitToggleEvent: true });
Vue.nextTick() wrapper.vm
.$nextTick()
.then(() => { .then(() => {
expect(wrapper.vm.$el.querySelector('.js-report-section-container')).not.toHaveCss(
hiddenCss,
);
expect(wrapper.vm.$el.querySelector('button')).toBeNull();
expect(wrapper.emitted().toggleEvent).toBeUndefined(); expect(wrapper.emitted().toggleEvent).toBeUndefined();
}) })
.then(done) .then(done)
.catch(done.fail); .catch(done.fail);
}); });
}); });
});
describe('with failed request', () => { describe('with failed request', () => {
it('should render error indicator', () => { it('should render error indicator', () => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment