Refstack pop up window should remain open before users click close.
Closes-Bug: #1492360 Change-Id: I91a56602e69e795f3d1e94dba89d50253ada0da6
This commit is contained in:
parent
4c69e1764e
commit
8f730eb46f
@ -27,16 +27,15 @@ refstackApp.factory('raiseAlert',
|
||||
|
||||
|
||||
refstackApp.controller('raiseAlertModalController',
|
||||
['$scope', '$modalInstance', '$interval', 'data',
|
||||
function ($scope, $modalInstance, $interval, data) {
|
||||
['$scope', '$modalInstance', 'data',
|
||||
function ($scope, $modalInstance, data) {
|
||||
'use strict';
|
||||
$scope.data = data;
|
||||
|
||||
//wait for users click to close the pop up window.
|
||||
$scope.close = function() {
|
||||
$modalInstance.close();
|
||||
};
|
||||
$interval(function(){
|
||||
$scope.close();
|
||||
}, 3000, 1);
|
||||
}
|
||||
]
|
||||
);
|
||||
|
@ -582,4 +582,34 @@ describe('Refstack controllers', function () {
|
||||
expect(scope.getTestListString()).toEqual(expectedString);
|
||||
});
|
||||
});
|
||||
|
||||
describe('testRaiseAlertModalController', function() {
|
||||
var data;
|
||||
var scope, modalInstance;
|
||||
|
||||
data = {
|
||||
mode: 'success',
|
||||
title: '',
|
||||
text: 'operation successful'
|
||||
};
|
||||
|
||||
beforeEach(inject(function ($rootScope, $controller) {
|
||||
scope = $rootScope.$new();
|
||||
modalInstance = {
|
||||
dismiss: jasmine.createSpy('modalInstance.dismiss'),
|
||||
close: jasmine.createSpy('modalInstance.close')
|
||||
};
|
||||
$controller('raiseAlertModalController', {
|
||||
$scope: scope,
|
||||
$modalInstance: modalInstance,
|
||||
data: data
|
||||
});
|
||||
}));
|
||||
|
||||
it('should close',
|
||||
function () {
|
||||
scope.close();
|
||||
expect(modalInstance.close).toHaveBeenCalledWith();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user