fix: front test
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
eda70b009b
commit
c30242f9cc
|
@ -4,12 +4,15 @@ describe('Item', () => {
|
||||||
describe('Component vnItemCard', () => {
|
describe('Component vnItemCard', () => {
|
||||||
let controller;
|
let controller;
|
||||||
let $httpBackend;
|
let $httpBackend;
|
||||||
|
let $state;
|
||||||
let data = {id: 1, name: 'fooName'};
|
let data = {id: 1, name: 'fooName'};
|
||||||
|
|
||||||
beforeEach(ngModule('item'));
|
beforeEach(ngModule('item'));
|
||||||
|
|
||||||
beforeEach(inject(($componentController, _$httpBackend_, $stateParams) => {
|
beforeEach(inject(($componentController, _$httpBackend_, $stateParams, _$state_) => {
|
||||||
$httpBackend = _$httpBackend_;
|
$httpBackend = _$httpBackend_;
|
||||||
|
$state = _$state_;
|
||||||
|
$state.getCurrentPath = () => [null, null, null, null, {state: {name: 'item.card.diary'}}];
|
||||||
|
|
||||||
let $element = angular.element('<div></div>');
|
let $element = angular.element('<div></div>');
|
||||||
controller = $componentController('vnItemCard', {$element});
|
controller = $componentController('vnItemCard', {$element});
|
||||||
|
@ -19,6 +22,7 @@ describe('Item', () => {
|
||||||
}));
|
}));
|
||||||
|
|
||||||
it('should request data and set it on the controller', () => {
|
it('should request data and set it on the controller', () => {
|
||||||
|
$httpBackend.expect('GET', `ItemConfigs/findOne`).respond({});
|
||||||
controller.reload();
|
controller.reload();
|
||||||
$httpBackend.flush();
|
$httpBackend.flush();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue