UNPKG

956 BJavaScriptView Raw
1import test from 'ava';
2import {formatLink} from '../parser/index';
3
4test('Should convert 2015 / 004 to FS16', t => {
5 const old = 'https://studentservices.uzh.ch/uzh/anonym/vvz?sap-client001&sap-language=EN#/details/2015/004/SM/50510833';
6 const expected = `http://www.vorlesungen.uzh.ch/FS16/suche/sm-50510833.modveranst.html`;
7 t.is(formatLink(old), expected);
8});
9
10test('Should convert 2014 / 003 to HS14', t => {
11 const old = 'https://studentservices.uzh.ch/uzh/anonym/vvz?sap-client001&sap-language=EN#/details/2015/004/SM/50510833';
12 const expected = `http://www.vorlesungen.uzh.ch/FS16/suche/sm-50510833.modveranst.html`;
13 t.is(formatLink(old), expected);
14});
15
16test('Should work with a CW url', t => {
17 const old = 'https://studentservices.uzh.ch/anonym/vvz?sap-client001&sap-language=DE#/details/2016/003/CW/50441681';
18 const expected = `http://www.vorlesungen.uzh.ch/HS16/suche/cw-50441681.modveranst.html`;
19 t.is(formatLink(old), expected);
20});