1
0
mirror of https://github.com/xuthus83/pigallery2.git synced 2024-11-03 21:04:03 +08:00
pigallery2/test/common/unit/Utils.spec.ts

19 lines
932 B
TypeScript
Raw Normal View History

2019-01-19 20:00:38 +08:00
import {expect} from 'chai';
import {Utils} from '../../../common/Utils';
describe('Utils', () => {
it('should concat urls', () => {
expect(Utils.concatUrls('abc', 'cde')).to.be.equal('abc/cde');
expect(Utils.concatUrls('abc/', 'cde')).to.be.equal('abc/cde');
expect(Utils.concatUrls('abc\\', 'cde')).to.be.equal('abc/cde');
expect(Utils.concatUrls('abc/', 'cde/')).to.be.equal('abc/cde');
expect(Utils.concatUrls('./abc\\', 'cde/')).to.be.equal('./abc/cde');
expect(Utils.concatUrls('abc/', '\\cde/')).to.be.equal('abc/cde');
expect(Utils.concatUrls('abc\\', '\\cde/')).to.be.equal('abc/cde');
expect(Utils.concatUrls('abc\\', '/cde/')).to.be.equal('abc/cde');
expect(Utils.concatUrls('abc/', '/cde/')).to.be.equal('abc/cde');
expect(Utils.concatUrls('abc\\/', '/cde/')).to.be.equal('abc/cde');
expect(Utils.concatUrls('abc\\/', '/cde/', 'fgh')).to.be.equal('abc/cde/fgh');
});
});