diff options
Diffstat (limited to 'spec/frontend/ide/stores/plugins/terminal_sync_spec.js')
-rw-r--r-- | spec/frontend/ide/stores/plugins/terminal_sync_spec.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/frontend/ide/stores/plugins/terminal_sync_spec.js b/spec/frontend/ide/stores/plugins/terminal_sync_spec.js index 2aa3e770e7d..0e5f4184679 100644 --- a/spec/frontend/ide/stores/plugins/terminal_sync_spec.js +++ b/spec/frontend/ide/stores/plugins/terminal_sync_spec.js @@ -4,6 +4,7 @@ import { SET_SESSION_STATUS } from '~/ide/stores/modules/terminal/mutation_types import { RUNNING, STOPPING } from '~/ide/stores/modules/terminal/constants'; import { createStore } from '~/ide/stores'; import eventHub from '~/ide/eventhub'; +import { createTriggerUpdatePayload } from '../../helpers'; jest.mock('~/ide/lib/mirror'); @@ -51,6 +52,14 @@ describe('IDE stores/plugins/mirror', () => { expect(store.dispatch).toHaveBeenCalledWith(ACTION_UPLOAD); }); + it('does nothing when ide.files.change is emitted with "update"', () => { + eventHub.$emit(FILES_CHANGE_EVENT, createTriggerUpdatePayload('foo')); + + jest.runAllTimers(); + + expect(store.dispatch).not.toHaveBeenCalledWith(ACTION_UPLOAD); + }); + describe('when session stops', () => { beforeEach(() => { store.commit(`terminal/${SET_SESSION_STATUS}`, STOPPING); |