UI updates, unit test fixes

This commit is contained in:
Katie Kroell 2026-01-09 14:02:28 -05:00
parent 2f557137e0
commit 5e681ff909
2 changed files with 35 additions and 33 deletions

View file

@ -55,7 +55,7 @@ function getMountedComponent(mainInitialState = {}, initialData = {}, methodToRu
return { wrapper }; return { wrapper };
} }
const duplicateOrderText = 'Finish Existing Claim'; const duplicateOrderText = 'Finish existing claim';
describe('duplicateCheck.vue', () => { describe('duplicateCheck.vue', () => {
describe('Rendering', () => { describe('Rendering', () => {
@ -313,26 +313,6 @@ describe('duplicateCheck.vue', () => {
// Assert // Assert
expect(wrapper.vm.getNewOrderSelectionName).toBe(''); expect(wrapper.vm.getNewOrderSelectionName).toBe('');
}); });
test('answersFromCms first item has Name property => returns expected', () => {
// Arrange
const mountOptions = getMountOptions({
router: { navigate: jest.fn() }
});
const expectedName = getRandomString(6, 6);
const answersFromCmsValue = [{ Name: expectedName }];
mountOptions.mixins = [{
methods: {
getCmsContent: jest.fn().mockImplementation((_, label) => (label === 'Answers'
? answersFromCmsValue
: ''))
}
}];
const wrapper = shallowMount(duplicateCheck, mountOptions);
// Assert
expect(wrapper.vm.getNewOrderSelectionName).toBe(expectedName);
});
}); });
}); });

View file

@ -23,11 +23,16 @@
class="duplicate-check-question" class="duplicate-check-question"
:cmsWidgetName="widget.existingOrNewQuestion" :cmsWidgetName="widget.existingOrNewQuestion"
:questionText="questionText" :questionText="questionText"
:answers="answers" :answers="duplicateOrders"
groupName="existingOrNewQuestionOption" groupName="existingOrNewQuestionOption"
buttonTypeString="listButton" buttonTypeString="listButton"
isRequired isRequired
:validationRules="rules.selectionRequired" /> :validationRules="rules.selectionRequired" />
<buttonMain
:variant="buttonVariants.primary"
buttonText="Start a new claim"
class="w-100"
@clickEvent="startNewClaim" />
<siteFooter <siteFooter
ref="siteFooter" ref="siteFooter"
class="my-5" class="my-5"
@ -48,6 +53,8 @@ import siteHeader from '@/iss-components/site-header/site-header.vue';
import siteFooter from '@/iss-components/site-footer/site-footer.vue'; import siteFooter from '@/iss-components/site-footer/site-footer.vue';
import siteSubHeader from '@/iss-components/site-sub-header/site-sub-header.vue'; import siteSubHeader from '@/iss-components/site-sub-header/site-sub-header.vue';
import buttonQuestion from '@/digital-components/button-question/button-question.vue'; import buttonQuestion from '@/digital-components/button-question/button-question.vue';
import buttonMain from '@/ux-components/button-main/button-main.vue';
import buttonVariants from '@/constants/button-variants';
// Supporting files // Supporting files
import { fetchCmsContentForPage } from '@/helpers/cms-content-helper.js'; import { fetchCmsContentForPage } from '@/helpers/cms-content-helper.js';
@ -66,7 +73,8 @@ export default {
buttonQuestion, buttonQuestion,
siteFooter, siteFooter,
// eslint-disable-next-line vue/no-reserved-component-names // eslint-disable-next-line vue/no-reserved-component-names
Form Form,
buttonMain
}, },
mixins: [BaseFormMixin], mixins: [BaseFormMixin],
async beforeRouteEnter(to, from, next) { async beforeRouteEnter(to, from, next) {
@ -91,18 +99,14 @@ export default {
}, },
rules: { rules: {
selectionRequired: globalRules.OPTION_REQUIRED selectionRequired: globalRules.OPTION_REQUIRED
} },
buttonVariants
}; };
}, },
computed: { computed: {
questionText() { questionText() {
return this.getCmsContent(this.widget.existingOrNewQuestion, 'QuestionText'); return this.getCmsContent(this.widget.existingOrNewQuestion, 'QuestionText');
}, },
answersFromCms() {
return (
this.getCmsContent(this.widget.existingOrNewQuestion, 'Answers') ?? []
);
},
getNewOrderSelectionName() { getNewOrderSelectionName() {
return this.answersFromCms?.[0]?.Name ?? ''; return this.answersFromCms?.[0]?.Name ?? '';
}, },
@ -127,9 +131,6 @@ export default {
}; };
}) ?? [] }) ?? []
); );
},
answers() {
return [...this.duplicateOrders, ...this.answersFromCms];
} }
}, },
methods: { methods: {
@ -197,6 +198,10 @@ export default {
this.$route this.$route
); );
} }
},
async startNewClaim() {
this.selectedAnswer = 'NewClaim';
await this.forwardButtonAction();
} }
} }
}; };
@ -217,6 +222,7 @@ export default {
margin-top: map-get($spacers, 2); margin-top: map-get($spacers, 2);
} }
} }
.duplicate-check-question { .duplicate-check-question {
span { span {
font-weight:600; font-weight:600;
@ -225,10 +231,26 @@ export default {
justify-content: left; justify-content: left;
display: inline-flex !important; display: inline-flex !important;
margin-top: map-get($spacers, 4); margin-top: map-get($spacers, 4);
margin-bottom: map-get($spacers, 2); margin-bottom: 0.625rem !important;
} }
.form-test-error { .form-test-error {
margin-top: 0 !important; margin-top: 0 !important;
} }
} }
.list-button-content {
span.small {
font-weight: 400;
}
}
.subheader-secondary {
p {
margin-bottom: 0.25rem !important;
}
}
.form-group {
margin-bottom: 1.25rem !important;
}
</style> </style>