diff options
Diffstat (limited to 'spec/javascripts/ide/lib/common/model_manager_spec.js')
-rw-r--r-- | spec/javascripts/ide/lib/common/model_manager_spec.js | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/spec/javascripts/ide/lib/common/model_manager_spec.js b/spec/javascripts/ide/lib/common/model_manager_spec.js index 4381f6fcfd0..c00d590c580 100644 --- a/spec/javascripts/ide/lib/common/model_manager_spec.js +++ b/spec/javascripts/ide/lib/common/model_manager_spec.js @@ -27,9 +27,10 @@ describe('Multi-file editor library model manager', () => { }); it('caches model by file path', () => { - instance.addModel(file('path-name')); + const f = file('path-name'); + instance.addModel(f); - expect(instance.models.keys().next().value).toBe('path-name'); + expect(instance.models.keys().next().value).toBe(f.key); }); it('adds model into disposable', () => { @@ -56,7 +57,7 @@ describe('Multi-file editor library model manager', () => { instance.addModel(f); expect(eventHub.$on).toHaveBeenCalledWith( - `editor.update.model.dispose.${f.path}`, + `editor.update.model.dispose.${f.key}`, jasmine.anything(), ); }); @@ -68,9 +69,11 @@ describe('Multi-file editor library model manager', () => { }); it('returns true when model exists', () => { - instance.addModel(file('path-name')); + const f = file('path-name'); + + instance.addModel(f); - expect(instance.hasCachedModel('path-name')).toBeTruthy(); + expect(instance.hasCachedModel(f.key)).toBeTruthy(); }); }); @@ -103,7 +106,7 @@ describe('Multi-file editor library model manager', () => { instance.removeCachedModel(f); expect(eventHub.$off).toHaveBeenCalledWith( - `editor.update.model.dispose.${f.path}`, + `editor.update.model.dispose.${f.key}`, jasmine.anything(), ); }); |