diff options
author | jerasmus <jerasmus@gitlab.com> | 2018-10-29 14:25:43 +0200 |
---|---|---|
committer | jerasmus <jerasmus@gitlab.com> | 2018-10-29 14:25:43 +0200 |
commit | 3dc5bb6245d5336231078805598adbfdeb331d2d (patch) | |
tree | 73087bb640ac0d53e5369ea5929bd9c1ff97cf30 | |
parent | c23c0f59b3d022e2700b43c8f23807861ba6bea3 (diff) | |
download | gitlab-ce-52122-fix-broken-whitespace-button.tar.gz |
Update unit tests52122-fix-broken-whitespace-button
Updated unit tests to conform to FE standards.
-rw-r--r-- | spec/javascripts/diffs/components/compare_versions_spec.js | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/spec/javascripts/diffs/components/compare_versions_spec.js b/spec/javascripts/diffs/components/compare_versions_spec.js index 2b6d7cae183..d9d7f61785f 100644 --- a/spec/javascripts/diffs/components/compare_versions_spec.js +++ b/spec/javascripts/diffs/components/compare_versions_spec.js @@ -100,20 +100,26 @@ describe('CompareVersions', () => { }); describe('isWhitespaceVisible', () => { + const originalHref = window.location.href; + + afterEach(() => { + window.history.replaceState({}, null, originalHref); + }); + it('should return "true" when no "w" flag is present in the URL (default)', () => { - expect(vm.isWhitespaceVisible()).toBeTruthy(); + expect(vm.isWhitespaceVisible()).toBe(true); }); it('should return "false" when the flag is set to "1" in the URL', () => { window.history.replaceState({}, null, '?w=1'); - expect(vm.isWhitespaceVisible()).toBeFalsy(); + expect(vm.isWhitespaceVisible()).toBe(false); }); it('should return "true" when the flag is set to "0" in the URL', () => { window.history.replaceState({}, null, '?w=0'); - expect(vm.isWhitespaceVisible()).toBeTruthy(); + expect(vm.isWhitespaceVisible()).toBe(true); }); }); }); |