2020-03-09 08:00:03 +00:00
|
|
|
import './index';
|
|
|
|
|
2023-12-11 11:40:16 +00:00
|
|
|
fdescribe('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');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|