update tests

This commit is contained in:
Dennis Tang 2018-05-28 17:53:57 +02:00
parent 2e4bea09a6
commit f7efc5f8b7
2 changed files with 22 additions and 3 deletions

View File

@ -47,7 +47,7 @@ describe('GkeProjectIdDropdown', () => {
});
it('returns project billing validation text', () => {
vm.isValidatingProjectBilling = true;
vm.setIsValidatingProjectBilling(true);
expect(vm.toggleText).toBe(LABELS.VALIDATING_PROJECT_BILLING);
});

View File

@ -50,6 +50,19 @@ describe('GCP Cluster Dropdown Store Actions', () => {
});
});
describe('setIsValidatingProjectBilling', () => {
it('should set machine type', done => {
testAction(
actions.setIsValidatingProjectBilling,
true,
{ isValidatingProjectBilling: null },
[{ type: 'SET_IS_VALIDATING_PROJECT_BILLING', payload: true }],
[],
done,
);
});
});
describe('async fetch methods', () => {
window.gapi = gapi();
@ -74,10 +87,16 @@ describe('GCP Cluster Dropdown Store Actions', () => {
true,
{
selectedProject: selectedProjectMock,
selectedZone: '',
selectedMachineType: '',
projectHasBillingEnabled: null,
},
[{ type: 'SET_PROJECT_BILLING_STATUS', payload: true }],
[],
[
{ type: 'SET_ZONE', payload: '' },
{ type: 'SET_MACHINE_TYPE', payload: '' },
{ type: 'SET_PROJECT_BILLING_STATUS', payload: true },
],
[{ type: 'setIsValidatingProjectBilling', payload: false }],
done,
);
});