stores/tables/insurance: remove method setManyRowOptions
This commit is contained in:
parent
90b63ae082
commit
bd2404c3db
@ -83,67 +83,6 @@ describe('stores/tables/insurance', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('[method] setManyRowOptions', () => {
|
|
||||||
it('should replace only kasko options', () => {
|
|
||||||
const rootStore = new RootStore();
|
|
||||||
const { insurance } = rootStore.$tables;
|
|
||||||
|
|
||||||
insurance.setManyRowOptions({
|
|
||||||
kasko: {
|
|
||||||
insuranceCompany: INSURANCE_COMPANIES_OPTIONS,
|
|
||||||
insured: INSURED_OPTIONS,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
const KASKO = toJS(insurance.getRowOptions('kasko'));
|
|
||||||
const OSAGO = toJS(insurance.getRowOptions('osago'));
|
|
||||||
const FINGAP = toJS(insurance.getRowOptions('fingap'));
|
|
||||||
|
|
||||||
expect(KASKO).toEqual({
|
|
||||||
insuranceCompany: INSURANCE_COMPANIES_OPTIONS,
|
|
||||||
insured: INSURED_OPTIONS,
|
|
||||||
insTerm: defaultOptions.kasko.insTerm,
|
|
||||||
});
|
|
||||||
|
|
||||||
expect(OSAGO).toEqual(defaultOptions.osago);
|
|
||||||
|
|
||||||
expect(FINGAP).toEqual(defaultOptions.fingap);
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should replace only kasko and osago options', () => {
|
|
||||||
const rootStore = new RootStore();
|
|
||||||
const { insurance } = rootStore.$tables;
|
|
||||||
|
|
||||||
insurance.setManyRowOptions({
|
|
||||||
kasko: {
|
|
||||||
insuranceCompany: INSURANCE_COMPANIES_OPTIONS,
|
|
||||||
insured: INSURED_OPTIONS,
|
|
||||||
},
|
|
||||||
osago: {
|
|
||||||
insured: INSURED_OPTIONS,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
const KASKO = toJS(insurance.getRowOptions('kasko'));
|
|
||||||
const OSAGO = toJS(insurance.getRowOptions('osago'));
|
|
||||||
const FINGAP = toJS(insurance.getRowOptions('fingap'));
|
|
||||||
|
|
||||||
expect(KASKO).toEqual({
|
|
||||||
insuranceCompany: INSURANCE_COMPANIES_OPTIONS,
|
|
||||||
insured: INSURED_OPTIONS,
|
|
||||||
insTerm: defaultOptions.kasko.insTerm,
|
|
||||||
});
|
|
||||||
|
|
||||||
expect(OSAGO).toEqual({
|
|
||||||
insuranceCompany: defaultOptions.osago.insuranceCompany,
|
|
||||||
insured: INSURED_OPTIONS,
|
|
||||||
insTerm: defaultOptions.osago.insTerm,
|
|
||||||
});
|
|
||||||
|
|
||||||
expect(FINGAP).toEqual(defaultOptions.fingap);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('[method] setRowStatuses', () => {
|
describe('[method] setRowStatuses', () => {
|
||||||
it('should replace only insuranceCompany and insured statuses', () => {
|
it('should replace only insuranceCompany and insured statuses', () => {
|
||||||
const rootStore = new RootStore();
|
const rootStore = new RootStore();
|
||||||
|
|||||||
@ -59,13 +59,6 @@ export default class InsuranceTable {
|
|||||||
this.options[key] = { ...this.options[key], ...rowOptions };
|
this.options[key] = { ...this.options[key], ...rowOptions };
|
||||||
};
|
};
|
||||||
|
|
||||||
setManyRowOptions = (options: Partial<Record<Insurance.Keys, Insurance.RowOptions>>) => {
|
|
||||||
(Object.keys(options) as Insurance.Keys[]).forEach((key) => {
|
|
||||||
const rowOptions = options[key];
|
|
||||||
if (rowOptions !== undefined) this.setRowOptions(key, rowOptions);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
getRowStatuses(key: Insurance.Keys) {
|
getRowStatuses(key: Insurance.Keys) {
|
||||||
return this.statuses[key];
|
return this.statuses[key];
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user