diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 1b61fa51c..f6d88a03d 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -28,7 +28,7 @@ resources: type: github name: Safelite/AzureDevOps endpoint: Safelite - ref: refs/tags/t5.5.35 + ref: refs/tags/t5.5.40 variables: - group: Digital-Infrastructure @@ -109,6 +109,58 @@ stages: paths: /fmg/* awsProfile: $(devDeploymentProfile) + # Test Build/Deploy + - stage: Test + condition: eq(variables['Build.SourceBranch'], variables['test-branch'] ) + variables: + - group: FixMyGlassTest + jobs: + - deployment: testBuildDeployment + displayName: Build and Deploy FMG - Test + environment: digitalCloud-sys + container: node + workspace: + clean: all + strategy: + runOnce: + deploy: + steps: + - checkout: self + clean: true + - template: templates/digital/step-build-vue.yml@AzureDevOps + parameters: + buildOutputDir: dist + environment: Test + - template: templates/digital/step-deploy-vue.yml@AzureDevOps + parameters: + artifactName: vueDistTest + awsProfile: $(sysDeploymentProfile) + outputPath: /fmg/ + deployBuckets: + safelite-sys-fmg-us-east-1: + clearFolder: true + deployFolder: "" + region: us-east-1 + safelite-sys-fmg-us-east-2: + clearFolder: true + deployFolder: "" + region: us-east-2 + appDeployVariables: + __VUE_APP_CONSUMER_CF_DISTRO__: $(__VUE_APP_CONSUMER_CF_DISTRO__) + __VUE_APP_GOOGLE_PLACES_API_KEY__: $(__VUE_APP_GOOGLE_PLACES_API_KEY__) + __VUE_APP_HERITAGE_FUNNEL__: $(__VUE_APP_HERITAGE_FUNNEL__) + __VUE_APP_CURRENT_ENVIRONMENT__: $(__VUE_APP_CURRENT_ENVIRONMENT__) + indexDeployVariables: + __VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY__: $(__VUE_APP_GOOGLE_TAG_MANAGER_SCRIPT_BODY__) + __VUE_APP_GOOGLE_TAG_MANAGER_NOSCRIPT_FRAME_SRC__: $(__VUE_APP_GOOGLE_TAG_MANAGER_NOSCRIPT_FRAME_SRC__) + cfDistributionId: $(vueCfDistributionId) + - template: templates/digital/invalidate-cloudfront-cache.yml@AzureDevOps + parameters: + awsCliContainer: awscli + distributionId: $(apiCfDistributionId) + paths: /fmg/* + awsProfile: $(sysDeploymentProfile) + # QA Build/Deploy - stage: Qa condition: eq(variables['Build.SourceBranch'], variables['qa-branch'] ) diff --git a/jest.config.js b/jest.config.js index 80b382c5a..c5401c28f 100644 --- a/jest.config.js +++ b/jest.config.js @@ -28,7 +28,7 @@ module.exports = { testMatch: ["**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)"], coverageThreshold: { global: { - statements: 83, + statements: 82, // Got the go ahead from Mark to temporarily lower this. Taking out initialize component made the year,make,model and style coverage drop a bit. Once unit tests for license plate lookup, vin lookup and address lookup are in the coverage should go back up to 90 }, }, diff --git a/src/App.vue b/src/App.vue index 75e80355f..aef77fcb0 100644 --- a/src/App.vue +++ b/src/App.vue @@ -23,4 +23,5 @@ export default { @import "@/styles/common-typography-styles.scss"; @import "@/styles/common-error-styles.scss"; @import "@/styles/common-animations.scss"; +@import "@/styles/shared-input-button-styles.scss"; diff --git a/src/common-components/base-input-button/base-input-button.spec.js b/src/common-components/base-input-button/base-input-button.spec.js index 87e8af6d2..8a3ff6356 100644 --- a/src/common-components/base-input-button/base-input-button.spec.js +++ b/src/common-components/base-input-button/base-input-button.spec.js @@ -228,7 +228,7 @@ describe("baseInputButton.vue", () => { expect(wrapper.emitted()).not.toHaveProperty("update:modelValue"); }); - test("focus and click enter on a checkbox => update:modelValue is emitted with correct value", async () => { + test("focus and click enter on a checkbox => nothing should happen", async () => { // Arrange const { wrapper } = setupMocks({ mockData: { @@ -243,9 +243,10 @@ describe("baseInputButton.vue", () => { // Act await input.trigger("keypress", { key: "enter" }); + console.log(wrapper.emitted()["update:modelValue"]); // Assert - expect(wrapper.emitted()["update:modelValue"][0][0]).toEqual(["Hi"]); + expect(wrapper.emitted()["update:modelValue"]).toBe(undefined); }); }); @@ -319,7 +320,7 @@ describe("baseInputButton.vue", () => { expect(wrapper.vm.handlePushClickEventToGACheck).not.toHaveBeenCalled(); }); - test("eventType === eventTypes.ENTER => call handleClick and handlePushClickEventToGACheck", () => { + test("eventType === eventTypes.ENTER => do nothing", () => { // Arrange const { wrapper } = setupMocks({ mockData: { @@ -336,11 +337,9 @@ describe("baseInputButton.vue", () => { wrapper.vm.handleEventAction("enter", { myEvent: "test" }); // Assert - expect(wrapper.vm.handleClick).toHaveBeenCalledWith({ - myEvent: "test", - }); - expect(wrapper.vm.handlePushClickEventToGACheck).toHaveBeenCalledWith("click"); + expect(wrapper.vm.handleClick).not.toHaveBeenCalled(); expect(wrapper.vm.handleSelectionChange).not.toHaveBeenCalled(); + expect(wrapper.vm.handlePushClickEventToGACheck).not.toHaveBeenCalled(); }); test("eventType === eventTypes.CHANGE => call handleClick and handlePushClickEventToGACheck", () => { diff --git a/src/common-components/base-input-button/base-input-button.vue b/src/common-components/base-input-button/base-input-button.vue index b71f4a63c..572be9ef5 100644 --- a/src/common-components/base-input-button/base-input-button.vue +++ b/src/common-components/base-input-button/base-input-button.vue @@ -1,6 +1,6 @@