Fix public page URL JS test

Stub the port so it doesn't use the one configured by karma
This commit is contained in:
Vincent Petry 2016-01-08 13:25:38 +01:00
parent 074a7fd475
commit 9b595474af
1 changed files with 3 additions and 1 deletions

View File

@ -21,12 +21,13 @@
describe('OCA.Sharing.PublicApp tests', function() {
var App = OCA.Sharing.PublicApp;
var hostStub, protocolStub, webrootStub;
var hostStub, portStub, protocolStub, webrootStub;
var $preview;
beforeEach(function() {
protocolStub = sinon.stub(OC, 'getProtocol').returns('https');
hostStub = sinon.stub(OC, 'getHost').returns('example.com');
portStub = sinon.stub(OC, 'getPort').returns(9876);
webrootStub = sinon.stub(OC, 'getRootPath').returns('/owncloud');
$preview = $('<div id="preview"></div>');
$('#testArea').append($preview);
@ -40,6 +41,7 @@ describe('OCA.Sharing.PublicApp tests', function() {
afterEach(function() {
protocolStub.restore();
hostStub.restore();
portStub.restore();
webrootStub.restore();
});