adjust js tests

Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
Robin Appelman 2016-12-02 13:40:23 +01:00
parent 8a3b660969
commit e055fbd4da
No known key found for this signature in database
GPG Key ID: 425003AC385454C5
1 changed files with 4 additions and 0 deletions

View File

@ -969,8 +969,11 @@ describe('Core base tests', function() {
var reloadStub, ajaxErrorStub, clock;
var notificationStub;
var waitTimeMs = 6000;
var oldCurrentUser;
beforeEach(function() {
oldCurrentUser = OC.currentUser;
OC.currentUser = 'dummy';
clock = sinon.useFakeTimers();
reloadStub = sinon.stub(OC, 'reload');
notificationStub = sinon.stub(OC.Notification, 'show');
@ -980,6 +983,7 @@ describe('Core base tests', function() {
window.initCore();
});
afterEach(function() {
OC.currentUser = oldCurrentUser;
reloadStub.restore();
notificationStub.restore();
clock.restore();