Skip to content
Snippets Groups Projects

Fix broken "Show whitespace changes" button on MR "Changes" tab

Merged Jacques Erasmus requested to merge 52122-fix-broken-whitespace-button into master
All threads resolved!
Compare and Show latest version
1 file
+ 9
3
Compare changes
  • Side-by-side
  • Inline
@@ -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);
});
});
});
Loading