DigitalConsumer.ISS/src/layouts/service-location/service-zip-modal-question/service-zip-question/service-zip-question.spec.js
DavidAtSafelite 80509bda53 We have advanced the code enough to call this one 8.5
It has more layout page linting and I have removed (really re-removed) the reduntant router parms.
2023-08-23 07:16:58 -04:00

39 lines
1.1 KiB
JavaScript

import { shallowMount } from '@vue/test-utils';
import serviceZipQuestion from '@/layouts/service-location/service-zip-modal-question/service-zip-question/service-zip-question.vue';
describe('service-zip-question.vue', () => {
it('Should get the modelValue', async () => {
// Arrange
const text = 'test';
const wrapper = shallowMount(serviceZipQuestion, {
props: {
modelValue: text
},
attachTo: document.body
});
// Act
const modelValueText = wrapper.vm.value;
wrapper.vm.value = 'test also';
// Assert
expect(modelValueText).toEqual('test');
});
it('Should emit to set value', async () => {
// Arrange
const text = 'test';
const wrapper = shallowMount(serviceZipQuestion, {
props: {
modelValue: text
},
attachTo: document.body
});
// Act
wrapper.vm.value = 'test also';
// Assert
expect(wrapper.emitted('update:modelValue')).toEqual([['test also']]);
});
});