Making a first test passing!

Signed-off-by: Cédric Foellmi <cedric@onekiloparsec.dev>
This commit is contained in:
Cédric Foellmi
2023-06-23 22:38:03 +02:00
committed by onekiloparsec
parent 1bee9c8b77
commit 04e552b7c3

13
tests/unit/Utils.spec.js Normal file
View File

@@ -0,0 +1,13 @@
import {Utils} from '@/js/Utils.ts';
describe('Utils.ts', () => {
beforeEach(() => {
delete window.location;
window.location = {href: {}, search: ''};
});
it('correctly parse a location parameter', () => {
window.location.search = '?survey=DSS';
expect(Utils.urlParam('survey')).toEqual('DSS');
});
});