Commit 3dc5bb62 authored by Jacques Erasmus's avatar Jacques Erasmus

Update unit tests

Updated unit tests to conform to FE standards.
parent c23c0f59
Pipeline #34675181 passed with stages
in 40 minutes and 59 seconds
......@@ -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);
});
});
});
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