Commit d255fd4f authored by Phil Hughes's avatar Phil Hughes

fixed error_message_spec

parent 8b687e07
...@@ -36,13 +36,15 @@ describe('IDE error message component', () => { ...@@ -36,13 +36,15 @@ describe('IDE error message component', () => {
}); });
describe('with action', () => { describe('with action', () => {
let actionSpy;
beforeEach(done => { beforeEach(done => {
vm.message.action = 'testAction'; actionSpy = jasmine.createSpy('action').and.returnValue(Promise.resolve());
vm.message.action = actionSpy;
vm.message.actionText = 'test action'; vm.message.actionText = 'test action';
vm.message.actionPayload = 'testActionPayload'; vm.message.actionPayload = 'testActionPayload';
spyOn(vm.$store, 'dispatch').and.returnValue(Promise.resolve());
vm.$nextTick(done); vm.$nextTick(done);
}); });
...@@ -63,7 +65,7 @@ describe('IDE error message component', () => { ...@@ -63,7 +65,7 @@ describe('IDE error message component', () => {
vm.$el.querySelector('.flash-action').click(); vm.$el.querySelector('.flash-action').click();
vm.$nextTick(() => { vm.$nextTick(() => {
expect(vm.$store.dispatch).toHaveBeenCalledWith('testAction', 'testActionPayload'); expect(actionSpy).toHaveBeenCalledWith('testActionPayload');
done(); done();
}); });
...@@ -74,7 +76,7 @@ describe('IDE error message component', () => { ...@@ -74,7 +76,7 @@ describe('IDE error message component', () => {
vm.$el.querySelector('.flash-action').click(); vm.$el.querySelector('.flash-action').click();
expect(vm.$store.dispatch).not.toHaveBeenCalledWith(); expect(actionSpy).not.toHaveBeenCalledWith();
}); });
it('resets isLoading after click', done => { it('resets isLoading after click', done => {
......
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