From 1cd4fe9e7d561e503e1adecae6307a6f6c21f188 Mon Sep 17 00:00:00 2001 From: Katie Kroell Date: Thu, 29 Feb 2024 16:13:21 -0500 Subject: [PATCH] title case and unit test fixes --- src/layouts/order-confirmation/order-confirmation.spec.js | 6 +++--- src/layouts/order-confirmation/order-confirmation.vue | 8 +++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/layouts/order-confirmation/order-confirmation.spec.js b/src/layouts/order-confirmation/order-confirmation.spec.js index b71dbcb4..590b5c1b 100644 --- a/src/layouts/order-confirmation/order-confirmation.spec.js +++ b/src/layouts/order-confirmation/order-confirmation.spec.js @@ -292,7 +292,7 @@ describe('OrderConfirmation.vue', () => { const testValue = wrapper.vm.appointmentWordingText; // Assert - expect(testValue).toEqual('wording Text 123 Safelite Street,
Mesa, AZ 12345'); + expect(testValue).toEqual('wording Text
123 Safelite Street,
Mesa, AZ 12345
'); }); test('appointmentWordingText should return In Shop text in expected format', () => { // Arrange @@ -302,7 +302,7 @@ describe('OrderConfirmation.vue', () => { const testValue = wrapper.vm.appointmentWordingText; // Assert - expect(testValue).toEqual('wording Text 123 Safelite Street,
Mesa, AZ 12345'); + expect(testValue).toEqual('wording Text
123 Safelite Street,
Mesa, AZ 12345
'); }); test('serviceLocationFullAddress should return text in expected format', () => { // Arrange @@ -322,7 +322,7 @@ describe('OrderConfirmation.vue', () => { const testValue = wrapper.vm.providerFullAddress; // Assert - expect(testValue).toEqual('123 Safelite Street,
Mesa, AZ 12345'); + expect(testValue).toEqual('
123 Safelite Street,
Mesa, AZ 12345
'); }); }); }); diff --git a/src/layouts/order-confirmation/order-confirmation.vue b/src/layouts/order-confirmation/order-confirmation.vue index 86670ff5..38f2dc9e 100644 --- a/src/layouts/order-confirmation/order-confirmation.vue +++ b/src/layouts/order-confirmation/order-confirmation.vue @@ -55,6 +55,7 @@ import { Form } from 'vee-validate'; import BaseFormMixin from '@/mixins/base-form-mixin.js'; import { useMainStore } from '@/store'; import { get12HourTimeFormat, get12HourTimeMobileFormat, convertDateStringToDate } from '@/helpers/date-helper.js'; +import { toTitleCase } from '@/helpers/text-helper.js'; export default { name: 'order-confirmation', @@ -150,10 +151,10 @@ export default { return `
${this.serviceLocationAddress}, ${this.serviceLocationAddress2 ? `${this.serviceLocationAddress2},` : ''}
${this.serviceLocationCity}, ${this.serviceLocationState} ${this.serviceLocationZipCode}
`; }, providerAddress() { - return this.mainStore.order.serviceLocation.provider.address.streetAddress; + return toTitleCase(this.mainStore.order.serviceLocation.provider.address.streetAddress); }, providerCity() { - return this.mainStore.order.serviceLocation.provider.address.city; + return toTitleCase(this.mainStore.order.serviceLocation.provider.address.city); }, providerState() { return this.mainStore.order.serviceLocation.provider.address.state; @@ -162,7 +163,8 @@ export default { return this.mainStore.order.serviceLocation.provider.address.zipCode; }, providerFullAddress() { - return `${this.providerAddress},
${this.providerCity}, ${this.providerState} ${this.providerZipCode}`; + // eslint-disable-next-line max-len + return `
${this.providerAddress},
${this.providerCity}, ${this.providerState} ${this.providerZipCode}
`; }, appointmentWordingText() { return this.formatWordingText(this.appointmentType);