Merge pull request #708 from Safelite/defect/CSR-807

CSR-807 Edit arePagePrerequisitesValid for estimate
This commit is contained in:
katieoh-safelite 2022-08-30 14:38:55 -04:00 committed by GitHub
commit 9f02569308
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View file

@ -49,19 +49,22 @@ describe("estimate.vue", () => {
//Assert
expect(arePagePrerequisitesValid).toBe(true);
});
test("isRepair is set to false, arePagePrerequisitesValid should return true", async () => {
test("isRepair is set to true, arePagePrerequisitesValid should return true", async () => {
//Arrange
const { wrapper } = setupMocks({});
//Act
store.commit( storeMutations.UPDATE_IS_REPAIR, false );
store.commit( storeMutations.UPDATE_IS_REPAIR, true );
let arePagePrerequisitesValid = wrapper.vm.arePagePrerequisitesValid();
//Assert
expect(arePagePrerequisitesValid).toBe(true);
});
test.todo("isRepair is false and there are no lineItems => should return false")
test.todo("isRepair is false and lineItems is null => should return false")
test.todo("isRepair is false are there are lineItems => should return true")
test("isRepair is set to null, arePagePrerequisitesValid should return false", async () => {
//Arrange

View file

@ -80,10 +80,7 @@ export default {
},
methods: {
arePagePrerequisitesValid() {
if(store.getters.damage.isRepair != null){
return true;
}
return false;
return store.getters.damage.isRepair || store.getters.damage.glassToReplace?.length > 0;
},
backButtonAction() {
// route to move backwards