2020-03-09 08:00:03 +00:00
|
|
|
import './index';
|
|
|
|
|
2024-01-31 12:16:56 +00:00
|
|
|
describe('component vnRoleCard', () => {
|
2020-03-09 08:00:03 +00:00
|
|
|
let controller;
|
|
|
|
let $httpBackend;
|
|
|
|
|
|
|
|
beforeEach(ngModule('account'));
|
|
|
|
|
|
|
|
beforeEach(inject(($componentController, _$httpBackend_) => {
|
|
|
|
$httpBackend = _$httpBackend_;
|
|
|
|
controller = $componentController('vnRoleCard', {$element: null});
|
|
|
|
}));
|
|
|
|
|
|
|
|
describe('reload()', () => {
|
|
|
|
it('should reload the controller data', () => {
|
|
|
|
controller.$params.id = 1;
|
|
|
|
|
2023-12-11 11:40:16 +00:00
|
|
|
$httpBackend.expectGET('VnRoles/1').respond('foo');
|
2020-03-09 08:00:03 +00:00
|
|
|
controller.reload();
|
|
|
|
$httpBackend.flush();
|
|
|
|
|
|
|
|
expect(controller.role).toBe('foo');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|