Starting outline of tests
This commit is contained in:
parent
4e4f99f7c9
commit
d5bf56418a
3 changed files with 58 additions and 2 deletions
|
|
@ -1,5 +1,7 @@
|
||||||
function getPriceOfLineItem(lineItem) {
|
function getPriceOfLineItem(lineItem) {
|
||||||
return lineItem.kitPrice + lineItem.laborAmount + lineItem.sellingPrice;
|
return (lineItem?.kitPrice ?? 0)
|
||||||
|
+ (lineItem?.laborAmount ?? 0)
|
||||||
|
+ (lineItem?.sellingPrice ?? 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function getPriceOfLineItems(lineItems) {
|
export default function getPriceOfLineItems(lineItems) {
|
||||||
|
|
|
||||||
|
|
@ -828,6 +828,60 @@ describe.skip('coverageStatement.vue', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('coverageStatement.vue-working', () => {
|
describe('coverageStatement.vue-working', () => {
|
||||||
|
// test('initial data is as expected', () => {});
|
||||||
|
describe('Rendering', () => {
|
||||||
|
test('Should render site header', () => {
|
||||||
|
// Arrange
|
||||||
|
const { wrapper } = getMountedComponent({});
|
||||||
|
|
||||||
|
// Act
|
||||||
|
const siteHeader = wrapper.findComponent({ ref: 'siteHeader' });
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
expect(siteHeader.exists()).toBe(true);
|
||||||
|
});
|
||||||
|
test('Should render site subheader', () => {
|
||||||
|
// Arrange
|
||||||
|
const { wrapper } = getMountedComponent({});
|
||||||
|
|
||||||
|
// Act
|
||||||
|
const subheader = wrapper.find({ ref: 'siteSubHeader' });
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
expect(subheader.exists()).toBe(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('Should render explanatory text', () => {
|
||||||
|
// Arrange
|
||||||
|
const { wrapper } = getMountedComponent({});
|
||||||
|
|
||||||
|
// Act
|
||||||
|
const explanatoryText = wrapper.find({ ref: 'explanatoryText' });
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
expect(explanatoryText.exists()).toBe(true);
|
||||||
|
});
|
||||||
|
test('Should render secondary text', () => {
|
||||||
|
// Arrange
|
||||||
|
const { wrapper } = getMountedComponent({});
|
||||||
|
|
||||||
|
// Act
|
||||||
|
const secondaryText = wrapper.find({ ref: 'secondaryText' });
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
expect(secondaryText.exists()).toBe(true);
|
||||||
|
});
|
||||||
|
test('Should render site footer', () => {
|
||||||
|
// Arrange
|
||||||
|
const { wrapper } = getMountedComponent({});
|
||||||
|
|
||||||
|
// Act
|
||||||
|
const footer = wrapper.findComponent({ ref: 'siteFooter' });
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
expect(footer.exists()).toBe(true);
|
||||||
|
});
|
||||||
|
});
|
||||||
describe('ITAC flag', () => {
|
describe('ITAC flag', () => {
|
||||||
test('ITAC flag updated once component is initialized', async () => {
|
test('ITAC flag updated once component is initialized', async () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
|
|
|
||||||
|
|
@ -200,7 +200,7 @@ export default {
|
||||||
vm.setCmsContent(resultMap.cmsContent);
|
vm.setCmsContent(resultMap.cmsContent);
|
||||||
vm.setSupportingItems(resultMap.supportingItems);
|
vm.setSupportingItems(resultMap.supportingItems);
|
||||||
// eslint-disable-next-line no-param-reassign
|
// eslint-disable-next-line no-param-reassign
|
||||||
vm.setAvailableLineItems(pricingResults);
|
vm.setBaseServiceLineItems(pricingResults);
|
||||||
vm.$refs.loadingModal.showModal();
|
vm.$refs.loadingModal.showModal();
|
||||||
vm.initializeComponent();
|
vm.initializeComponent();
|
||||||
if (!vm.unverified) {
|
if (!vm.unverified) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue