refactor claim_main controller
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
7c3945a921
commit
619baf2896
|
@ -1,13 +1,7 @@
|
|||
import ngModule from '../module';
|
||||
import ModuleMain from 'salix/components/module-main';
|
||||
|
||||
export default class Claims extends ModuleMain {
|
||||
constructor($element, $) {
|
||||
super($element, $);
|
||||
}
|
||||
}
|
||||
|
||||
ngModule.vnComponent('vnClaim', {
|
||||
controller: Claims,
|
||||
controller: ModuleMain,
|
||||
template: require('./index.html')
|
||||
});
|
||||
|
|
|
@ -25,7 +25,7 @@ class Controller extends Summary {
|
|||
.then(() => {
|
||||
if (this.card)
|
||||
this.card.reload();
|
||||
// Refresh index model
|
||||
|
||||
if (this.parentReload)
|
||||
this.parentReload();
|
||||
});
|
||||
|
|
|
@ -29,7 +29,7 @@ describe('Claim', () => {
|
|||
});
|
||||
|
||||
describe('changeState()', () => {
|
||||
it('should make an HTTP post query, then call the showSuccess(), reload() and resetChanges() methods', () => {
|
||||
it('should make an HTTP post query, then call the showSuccess()', () => {
|
||||
jest.spyOn(controller.vnApp, 'showSuccess').mockReturnThis();
|
||||
|
||||
const expectedParams = {id: 1, claimStateFk: 1};
|
||||
|
@ -43,7 +43,7 @@ describe('Claim', () => {
|
|||
});
|
||||
|
||||
describe('$onChanges()', () => {
|
||||
it('should call loadData when item.id is defined', () => {
|
||||
it('should call loadData when $onChanges is called', () => {
|
||||
jest.spyOn(controller, 'loadData');
|
||||
|
||||
controller.$onChanges();
|
||||
|
|
Loading…
Reference in New Issue