updated tests

This commit is contained in:
Bill Richardson 2024-03-07 19:31:42 -05:00
parent ad4ec7209c
commit 07b6493bda

View file

@ -156,9 +156,16 @@ function getMountedComponent(mainInitialState = {}, initialData = {}, methodToRu
}
describe('OrderConfirmation.vue', () => {
beforeEach(() => {
window.sessionStorage.clear();
});
afterEach(() => {
window.sessionStorage.removeItem('submittedOrder');
});
describe('Rendering', () => {
test('Should render Site Header', () => {
// Arrange
window.sessionStorage.setItem('submittedOrder', JSON.stringify(sessionStorage));
const { wrapper } = getMountedComponent(initialStore);
// Act
@ -169,6 +176,7 @@ describe('OrderConfirmation.vue', () => {
});
test('Should render Vehicle Banner', () => {
// Arrange
window.sessionStorage.setItem('submittedOrder', JSON.stringify(sessionStorage));
const { wrapper } = getMountedComponent(initialStore);
// Act
@ -179,6 +187,7 @@ describe('OrderConfirmation.vue', () => {
});
test('If Advanced flow, should display Site Footer', () => {
// Arrange
window.sessionStorage.setItem('submittedOrder', JSON.stringify(sessionStorage));
const testStore = {
order: {
schedule: {
@ -203,6 +212,7 @@ describe('OrderConfirmation.vue', () => {
});
test('If Essential flow, should not display Site Footer', () => {
// Arrange
window.sessionStorage.setItem('submittedOrder', JSON.stringify(sessionStorage));
const { wrapper } = getMountedComponent(initialStore);
// Act
@ -215,6 +225,7 @@ describe('OrderConfirmation.vue', () => {
describe('Navigation', () => {
test('If Advanced flow, forward button action navigates to carrier URL', () => {
// Arrange
window.sessionStorage.setItem('submittedOrder', JSON.stringify(sessionStorage));
const carrierReturnUrl = 'testURL';
const testStore = {
order: {
@ -240,12 +251,6 @@ describe('OrderConfirmation.vue', () => {
});
});
describe('Computed properties', () => {
beforeEach(() => {
window.sessionStorage.clear();
});
afterEach(() => {
window.sessionStorage.removeItem('submittedOrder');
});
test('appointmentDateFormatted should return date in expected format', () => {
// Arrange
window.sessionStorage.setItem('submittedOrder', JSON.stringify(sessionStorage));