More resultUrl tests to verify relative paths.

This commit is contained in:
Tobias Lidskog 2017-03-28 23:47:46 +02:00
parent d5a301309a
commit 1e6f9a23f6
1 changed files with 18 additions and 3 deletions

View File

@ -30,11 +30,16 @@ describe('resultUrls', function() {
expect(resultUrls.reportSummaryUrl())
.to.equal(`http://results.com/www.foo.bar/${timestampString}`);
});
it('should create url with custom output folder', function() {
it('should create url with absolute output folder', function() {
const resultUrls = createResultUrls('http://www.foo.bar', '/root/leaf', 'http://results.com');
expect(resultUrls.reportSummaryUrl())
.to.equal('http://results.com/leaf');
});
it('should create url with relative output folder', function() {
const resultUrls = createResultUrls('http://www.foo.bar', '../leaf', 'http://results.com');
expect(resultUrls.reportSummaryUrl())
.to.equal('http://results.com/leaf');
});
});
describe('#absoluteSummaryPageUrl', function() {
it('should create url with default output folder', function() {
@ -42,11 +47,16 @@ describe('resultUrls', function() {
expect(resultUrls.absoluteSummaryPageUrl('http://www.foo.bar/xyz'))
.to.equal(`http://results.com/www.foo.bar/${timestampString}/pages/www.foo.bar/xyz/`);
});
it('should create url with custom output folder', function() {
it('should create url with absolute output folder', function() {
const resultUrls = createResultUrls('http://www.foo.bar', '/root/leaf', 'http://results.com');
expect(resultUrls.absoluteSummaryPageUrl('http://www.foo.bar/xyz'))
.to.equal('http://results.com/leaf/pages/www.foo.bar/xyz/');
});
it('should create url with relative output folder', function() {
const resultUrls = createResultUrls('http://www.foo.bar', '../leaf', 'http://results.com');
expect(resultUrls.absoluteSummaryPageUrl('http://www.foo.bar/xyz'))
.to.equal('http://results.com/leaf/pages/www.foo.bar/xyz/');
});
});
describe('#relativeSummaryPageUrl', function() {
it('should create url with default output folder', function() {
@ -54,10 +64,15 @@ describe('resultUrls', function() {
expect(resultUrls.relativeSummaryPageUrl('http://www.foo.bar/xyz'))
.to.equal('pages/www.foo.bar/xyz/');
});
it('should create url with custom output folder', function() {
it('should create url with absolute output folder', function() {
const resultUrls = createResultUrls('http://www.foo.bar', '/root/leaf', 'http://results.com');
expect(resultUrls.relativeSummaryPageUrl('http://www.foo.bar/xyz'))
.to.equal('pages/www.foo.bar/xyz/');
});
it('should create url with relative output folder', function() {
const resultUrls = createResultUrls('http://www.foo.bar', '../leaf', 'http://results.com');
expect(resultUrls.relativeSummaryPageUrl('http://www.foo.bar/xyz'))
.to.equal('pages/www.foo.bar/xyz/');
});
});
});