Update unit tests to new design.
This commit is contained in:
parent
94cadf636e
commit
b82aab687c
1 changed files with 38 additions and 39 deletions
|
|
@ -77,11 +77,8 @@ const figmaScenarios = [
|
||||||
{
|
{
|
||||||
name: "05_01_CSR_Quote_Cash",
|
name: "05_01_CSR_Quote_Cash",
|
||||||
params: {
|
params: {
|
||||||
availableVaps: [
|
wiperResponse: [testConstants.parts.frontWiperPart, testConstants.parts.rearWiperPart],
|
||||||
testConstants.parts.frontWiperPart,
|
rainDefenseResponse: testConstants.parts.rainDefensePart,
|
||||||
testConstants.parts.rearWiperPart,
|
|
||||||
testConstants.parts.rainDefensePart,
|
|
||||||
],
|
|
||||||
damage: {
|
damage: {
|
||||||
isRepair: false,
|
isRepair: false,
|
||||||
glassToReplace: [testConstants.damages.frontWindshield],
|
glassToReplace: [testConstants.damages.frontWindshield],
|
||||||
|
|
@ -142,11 +139,8 @@ const figmaScenarios = [
|
||||||
{
|
{
|
||||||
name: "05_01_CSR_Quote_Standard_Repair",
|
name: "05_01_CSR_Quote_Standard_Repair",
|
||||||
params: {
|
params: {
|
||||||
availableVaps: [
|
wiperResponse: [testConstants.parts.frontWiperPart, testConstants.parts.rearWiperPart],
|
||||||
testConstants.parts.frontWiperPart,
|
rainDefenseResponse: testConstants.parts.rainDefensePart,
|
||||||
testConstants.parts.rearWiperPart,
|
|
||||||
testConstants.parts.rainDefensePart,
|
|
||||||
],
|
|
||||||
damage: {
|
damage: {
|
||||||
isRepair: true,
|
isRepair: true,
|
||||||
glassToReplace: [],
|
glassToReplace: [],
|
||||||
|
|
@ -206,11 +200,8 @@ const figmaScenarios = [
|
||||||
{
|
{
|
||||||
name: "05_01_CSR_Quote_Recal",
|
name: "05_01_CSR_Quote_Recal",
|
||||||
params: {
|
params: {
|
||||||
availableVaps: [
|
wiperResponse: [testConstants.parts.frontWiperPart, testConstants.parts.rearWiperPart],
|
||||||
testConstants.parts.frontWiperPart,
|
rainDefenseResponse: testConstants.parts.rainDefensePart,
|
||||||
testConstants.parts.rearWiperPart,
|
|
||||||
testConstants.parts.rainDefensePart,
|
|
||||||
],
|
|
||||||
damage: {
|
damage: {
|
||||||
isRepair: false,
|
isRepair: false,
|
||||||
glassToReplace: [testConstants.damages.frontWindshield],
|
glassToReplace: [testConstants.damages.frontWindshield],
|
||||||
|
|
@ -271,11 +262,8 @@ const figmaScenarios = [
|
||||||
{
|
{
|
||||||
name: "05_01_CSR_Quote_RearGlass+NonWindshield",
|
name: "05_01_CSR_Quote_RearGlass+NonWindshield",
|
||||||
params: {
|
params: {
|
||||||
availableVaps: [
|
wiperResponse: [testConstants.parts.frontWiperPart, testConstants.parts.rearWiperPart],
|
||||||
testConstants.parts.frontWiperPart,
|
rainDefenseResponse: testConstants.parts.rainDefensePart,
|
||||||
testConstants.parts.rearWiperPart,
|
|
||||||
testConstants.parts.rainDefensePart,
|
|
||||||
],
|
|
||||||
damage: {
|
damage: {
|
||||||
isRepair: false,
|
isRepair: false,
|
||||||
glassToReplace: [testConstants.damages.rearWindshield],
|
glassToReplace: [testConstants.damages.rearWindshield],
|
||||||
|
|
@ -343,11 +331,8 @@ const figmaScenarios = [
|
||||||
{
|
{
|
||||||
name: "05_01_CSR_Quote_RearGlass+Windshield",
|
name: "05_01_CSR_Quote_RearGlass+Windshield",
|
||||||
params: {
|
params: {
|
||||||
availableVaps: [
|
wiperResponse: [testConstants.parts.frontWiperPart, testConstants.parts.rearWiperPart],
|
||||||
testConstants.parts.frontWiperPart,
|
rainDefenseResponse: testConstants.parts.rainDefensePart,
|
||||||
testConstants.parts.rearWiperPart,
|
|
||||||
testConstants.parts.rainDefensePart,
|
|
||||||
],
|
|
||||||
damage: {
|
damage: {
|
||||||
isRepair: false,
|
isRepair: false,
|
||||||
glassToReplace: [
|
glassToReplace: [
|
||||||
|
|
@ -461,7 +446,8 @@ const figmaScenarios = [
|
||||||
{
|
{
|
||||||
name: "05_01_CSR_Quote_RearGlassNoFrontFit",
|
name: "05_01_CSR_Quote_RearGlassNoFrontFit",
|
||||||
params: {
|
params: {
|
||||||
availableVaps: [testConstants.parts.rearWiperPart, testConstants.parts.rainDefensePart],
|
wiperResponse: [testConstants.parts.rearWiperPart],
|
||||||
|
rainDefenseResponse: testConstants.parts.rainDefensePart,
|
||||||
damage: {
|
damage: {
|
||||||
isRepair: false,
|
isRepair: false,
|
||||||
glassToReplace: [testConstants.damages.rearWindshield],
|
glassToReplace: [testConstants.damages.rearWindshield],
|
||||||
|
|
@ -518,11 +504,8 @@ const figmaScenarios = [
|
||||||
{
|
{
|
||||||
name: "05_01_CSR_Quote_Windshield+SideGlass",
|
name: "05_01_CSR_Quote_Windshield+SideGlass",
|
||||||
params: {
|
params: {
|
||||||
availableVaps: [
|
wiperResponse: [testConstants.parts.frontWiperPart, testConstants.parts.rearWiperPart],
|
||||||
testConstants.parts.frontWiperPart,
|
rainDefenseResponse: testConstants.parts.rainDefensePart,
|
||||||
testConstants.parts.rearWiperPart,
|
|
||||||
testConstants.parts.rainDefensePart,
|
|
||||||
],
|
|
||||||
damage: {
|
damage: {
|
||||||
isRepair: false,
|
isRepair: false,
|
||||||
glassToReplace: [
|
glassToReplace: [
|
||||||
|
|
@ -586,11 +569,8 @@ const figmaScenarios = [
|
||||||
{
|
{
|
||||||
name: "05_01_CSR_Quote_SideGlass",
|
name: "05_01_CSR_Quote_SideGlass",
|
||||||
params: {
|
params: {
|
||||||
availableVaps: [
|
wiperResponse: [testConstants.parts.frontWiperPart, testConstants.parts.rearWiperPart],
|
||||||
testConstants.parts.frontWiperPart,
|
rainDefenseResponse: testConstants.parts.rainDefensePart,
|
||||||
testConstants.parts.rearWiperPart,
|
|
||||||
testConstants.parts.rainDefensePart,
|
|
||||||
],
|
|
||||||
damage: {
|
damage: {
|
||||||
isRepair: false,
|
isRepair: false,
|
||||||
glassToReplace: [testConstants.damages.sideGlass],
|
glassToReplace: [testConstants.damages.sideGlass],
|
||||||
|
|
@ -678,7 +658,8 @@ const figmaScenarios = [
|
||||||
{
|
{
|
||||||
name: "05_01_CSR_Quote_NoWiperFit",
|
name: "05_01_CSR_Quote_NoWiperFit",
|
||||||
params: {
|
params: {
|
||||||
availableVaps: [testConstants.parts.rainDefensePart],
|
wiperResponse: [],
|
||||||
|
rainDefenseResponse: testConstants.parts.rainDefensePart,
|
||||||
damage: {
|
damage: {
|
||||||
isRepair: false,
|
isRepair: false,
|
||||||
glassToReplace: [testConstants.damages.frontWindshield],
|
glassToReplace: [testConstants.damages.frontWindshield],
|
||||||
|
|
@ -821,6 +802,8 @@ describe("Service Package Review Block", () => {
|
||||||
propsData: props,
|
propsData: props,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
initializeWithDefault(wrapper);
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
await wrapper.vm.$nextTick();
|
await wrapper.vm.$nextTick();
|
||||||
|
|
||||||
|
|
@ -851,6 +834,8 @@ describe("Service Package Review Block", () => {
|
||||||
propsData: props,
|
propsData: props,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
initializeWithDefault(wrapper);
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
await wrapper.vm.$nextTick();
|
await wrapper.vm.$nextTick();
|
||||||
|
|
||||||
|
|
@ -874,6 +859,8 @@ describe("Service Package Review Block", () => {
|
||||||
// Act
|
// Act
|
||||||
await wrapper.vm.$nextTick();
|
await wrapper.vm.$nextTick();
|
||||||
|
|
||||||
|
initializeWithDefault(wrapper);
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
const includesFrontWiperCopy = wrapper.vm.displayContent.includes(
|
const includesFrontWiperCopy = wrapper.vm.displayContent.includes(
|
||||||
testConstants.vapsCopy.frontWiperCopy
|
testConstants.vapsCopy.frontWiperCopy
|
||||||
|
|
@ -893,6 +880,8 @@ describe("Service Package Review Block", () => {
|
||||||
propsData: generateDefaultProps(),
|
propsData: generateDefaultProps(),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
initializeWithDefault(wrapper);
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
await wrapper.vm.$nextTick();
|
await wrapper.vm.$nextTick();
|
||||||
|
|
||||||
|
|
@ -908,7 +897,6 @@ describe("Service Package Review Block", () => {
|
||||||
it(`Should match figma scenario "${scenario.name}", iteration "${iteration.name}"`, async () => {
|
it(`Should match figma scenario "${scenario.name}", iteration "${iteration.name}"`, async () => {
|
||||||
// Arrange
|
// Arrange
|
||||||
let props = generateDefaultProps();
|
let props = generateDefaultProps();
|
||||||
props.availableVaps = scenario.params.availableVaps;
|
|
||||||
props.damage = scenario.params.damage;
|
props.damage = scenario.params.damage;
|
||||||
props.glassParts = scenario.params.glassParts;
|
props.glassParts = scenario.params.glassParts;
|
||||||
props.lineItems.supportingItems = scenario.params.supportingItems;
|
props.lineItems.supportingItems = scenario.params.supportingItems;
|
||||||
|
|
@ -918,6 +906,11 @@ describe("Service Package Review Block", () => {
|
||||||
propsData: props,
|
propsData: props,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
wrapper.vm.initializeComponent({
|
||||||
|
wipers: scenario.params.wiperResponse,
|
||||||
|
rainDefense: scenario.params.rainDefenseResponse,
|
||||||
|
});
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
await wrapper.vm.$nextTick();
|
await wrapper.vm.$nextTick();
|
||||||
|
|
||||||
|
|
@ -932,12 +925,18 @@ describe("Service Package Review Block", () => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function initializeWithDefault(wrapper) {
|
||||||
|
wrapper.vm.initializeComponent({
|
||||||
|
wipers: [testConstants.parts.frontWiperPart],
|
||||||
|
rainDefense: testConstants.parts.rainDefensePart,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function generateDefaultProps() {
|
function generateDefaultProps() {
|
||||||
return {
|
return {
|
||||||
servicePackageOptionsCmsName: testConstants.cmsPropValues.servicePackageOptionsCmsName,
|
servicePackageOptionsCmsName: testConstants.cmsPropValues.servicePackageOptionsCmsName,
|
||||||
defaultPackageItemsCmsName: testConstants.cmsPropValues.defaultPackageItemsCmsName,
|
defaultPackageItemsCmsName: testConstants.cmsPropValues.defaultPackageItemsCmsName,
|
||||||
vapsItemsCmsName: testConstants.cmsPropValues.vapsItemsCmsName,
|
vapsItemsCmsName: testConstants.cmsPropValues.vapsItemsCmsName,
|
||||||
availableVaps: [testConstants.parts.frontWiperPart, testConstants.parts.rainDefensePart],
|
|
||||||
lineItems: {
|
lineItems: {
|
||||||
glassParts: [],
|
glassParts: [],
|
||||||
supportingItems: [],
|
supportingItems: [],
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue