Fixing tests
This commit is contained in:
parent
6dd0009cd2
commit
40c381fdb8
1 changed files with 82 additions and 114 deletions
|
|
@ -560,7 +560,6 @@ describe('Store', () => {
|
||||||
expect(globalMethods.callHttpClient).toHaveBeenCalledWith(expect.objectContaining(
|
expect(globalMethods.callHttpClient).toHaveBeenCalledWith(expect.objectContaining(
|
||||||
{
|
{
|
||||||
payload: expect.objectContaining({
|
payload: expect.objectContaining({
|
||||||
order: expect.objectContaining({
|
|
||||||
vehicle: expect.objectContaining({
|
vehicle: expect.objectContaining({
|
||||||
year: vehicle.year,
|
year: vehicle.year,
|
||||||
make: vehicle.make,
|
make: vehicle.make,
|
||||||
|
|
@ -571,7 +570,6 @@ describe('Store', () => {
|
||||||
licensePlateNumber: vehicle.registration.licensePlate
|
licensePlateNumber: vehicle.registration.licensePlate
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
});
|
});
|
||||||
|
|
@ -603,7 +601,6 @@ describe('Store', () => {
|
||||||
expect(globalMethods.callHttpClient).toHaveBeenCalledWith(expect.objectContaining(
|
expect(globalMethods.callHttpClient).toHaveBeenCalledWith(expect.objectContaining(
|
||||||
{
|
{
|
||||||
payload: expect.objectContaining({
|
payload: expect.objectContaining({
|
||||||
order: expect.objectContaining({
|
|
||||||
damage: expect.objectContaining({
|
damage: expect.objectContaining({
|
||||||
numberOfChips: damage.numberOfChips,
|
numberOfChips: damage.numberOfChips,
|
||||||
isRepair: damage.isRepair,
|
isRepair: damage.isRepair,
|
||||||
|
|
@ -618,7 +615,6 @@ describe('Store', () => {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
it('calls api with expected policy', () => {
|
it('calls api with expected policy', () => {
|
||||||
|
|
@ -650,7 +646,6 @@ describe('Store', () => {
|
||||||
expect(globalMethods.callHttpClient).toHaveBeenCalledWith(expect.objectContaining(
|
expect(globalMethods.callHttpClient).toHaveBeenCalledWith(expect.objectContaining(
|
||||||
{
|
{
|
||||||
payload: expect.objectContaining({
|
payload: expect.objectContaining({
|
||||||
order: expect.objectContaining({
|
|
||||||
policy: expect.objectContaining({
|
policy: expect.objectContaining({
|
||||||
policyHolder: expect.objectContaining({
|
policyHolder: expect.objectContaining({
|
||||||
policyFirstName: customer.firstName,
|
policyFirstName: customer.firstName,
|
||||||
|
|
@ -667,7 +662,6 @@ describe('Store', () => {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
it('calls api with expected customer', () => {
|
it('calls api with expected customer', () => {
|
||||||
|
|
@ -699,7 +693,6 @@ describe('Store', () => {
|
||||||
expect(globalMethods.callHttpClient).toHaveBeenCalledWith(expect.objectContaining(
|
expect(globalMethods.callHttpClient).toHaveBeenCalledWith(expect.objectContaining(
|
||||||
{
|
{
|
||||||
payload: expect.objectContaining({
|
payload: expect.objectContaining({
|
||||||
order: expect.objectContaining({
|
|
||||||
customer: expect.objectContaining({
|
customer: expect.objectContaining({
|
||||||
address: expect.objectContaining({
|
address: expect.objectContaining({
|
||||||
streetAddress: customer.address.streetAddress,
|
streetAddress: customer.address.streetAddress,
|
||||||
|
|
@ -716,7 +709,6 @@ describe('Store', () => {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
it('calls api with expected lineItems', () => {
|
it('calls api with expected lineItems', () => {
|
||||||
|
|
@ -736,7 +728,6 @@ describe('Store', () => {
|
||||||
expect(globalMethods.callHttpClient).toHaveBeenCalledWith(expect.objectContaining(
|
expect(globalMethods.callHttpClient).toHaveBeenCalledWith(expect.objectContaining(
|
||||||
{
|
{
|
||||||
payload: expect.objectContaining({
|
payload: expect.objectContaining({
|
||||||
order: expect.objectContaining({
|
|
||||||
lineItems: expect.objectContaining({
|
lineItems: expect.objectContaining({
|
||||||
glassParts: lineItems.glassParts,
|
glassParts: lineItems.glassParts,
|
||||||
supportingItems: lineItems.supportingItems,
|
supportingItems: lineItems.supportingItems,
|
||||||
|
|
@ -744,7 +735,6 @@ describe('Store', () => {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
it.each([
|
it.each([
|
||||||
|
|
@ -772,7 +762,6 @@ describe('Store', () => {
|
||||||
expect(globalMethods.callHttpClient).toHaveBeenCalledWith(expect.objectContaining(
|
expect(globalMethods.callHttpClient).toHaveBeenCalledWith(expect.objectContaining(
|
||||||
{
|
{
|
||||||
payload: expect.objectContaining({
|
payload: expect.objectContaining({
|
||||||
order: expect.objectContaining({
|
|
||||||
payment: expect.objectContaining({
|
payment: expect.objectContaining({
|
||||||
InsuranceCoverage: expect.objectContaining({
|
InsuranceCoverage: expect.objectContaining({
|
||||||
isVerified: payment.insuranceCoverage.isVerified,
|
isVerified: payment.insuranceCoverage.isVerified,
|
||||||
|
|
@ -783,7 +772,6 @@ describe('Store', () => {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
it('calls api with expected service location', () => {
|
it('calls api with expected service location', () => {
|
||||||
|
|
@ -807,7 +795,6 @@ describe('Store', () => {
|
||||||
expect(globalMethods.callHttpClient).toHaveBeenCalledWith(expect.objectContaining(
|
expect(globalMethods.callHttpClient).toHaveBeenCalledWith(expect.objectContaining(
|
||||||
{
|
{
|
||||||
payload: expect.objectContaining({
|
payload: expect.objectContaining({
|
||||||
order: expect.objectContaining({
|
|
||||||
serviceLocation: expect.objectContaining({
|
serviceLocation: expect.objectContaining({
|
||||||
address: expect.objectContaining({
|
address: expect.objectContaining({
|
||||||
streetAddress: serviceLocation.address,
|
streetAddress: serviceLocation.address,
|
||||||
|
|
@ -820,7 +807,6 @@ describe('Store', () => {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
it('calls api with expected schedule', () => {
|
it('calls api with expected schedule', () => {
|
||||||
|
|
@ -842,7 +828,6 @@ describe('Store', () => {
|
||||||
expect(globalMethods.callHttpClient).toHaveBeenCalledWith(expect.objectContaining(
|
expect(globalMethods.callHttpClient).toHaveBeenCalledWith(expect.objectContaining(
|
||||||
{
|
{
|
||||||
payload: expect.objectContaining({
|
payload: expect.objectContaining({
|
||||||
order: expect.objectContaining({
|
|
||||||
schedule: expect.objectContaining({
|
schedule: expect.objectContaining({
|
||||||
date: schedule.date,
|
date: schedule.date,
|
||||||
startTime: schedule.startTime,
|
startTime: schedule.startTime,
|
||||||
|
|
@ -852,7 +837,6 @@ describe('Store', () => {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
it('calls api with expected referral date', () => {
|
it('calls api with expected referral date', () => {
|
||||||
|
|
@ -867,9 +851,7 @@ describe('Store', () => {
|
||||||
// Assert
|
// Assert
|
||||||
expect(globalMethods.callHttpClient).toHaveBeenCalledWith(expect.objectContaining(
|
expect(globalMethods.callHttpClient).toHaveBeenCalledWith(expect.objectContaining(
|
||||||
{
|
{
|
||||||
payload: expect.objectContaining({
|
payload: expect.objectContaining({ referralDate: referralDate })
|
||||||
order: expect.objectContaining({ referralDate: referralDate })
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
@ -885,9 +867,7 @@ describe('Store', () => {
|
||||||
// Assert
|
// Assert
|
||||||
expect(globalMethods.callHttpClient).toHaveBeenCalledWith(expect.objectContaining(
|
expect(globalMethods.callHttpClient).toHaveBeenCalledWith(expect.objectContaining(
|
||||||
{
|
{
|
||||||
payload: expect.objectContaining({
|
payload: expect.objectContaining({ referralNumber: referralNumber })
|
||||||
order: expect.objectContaining({ referralNumber: referralNumber })
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
});
|
});
|
||||||
|
|
@ -902,16 +882,12 @@ describe('Store', () => {
|
||||||
// Asserts
|
// Asserts
|
||||||
expect(globalMethods.callHttpClient).toHaveBeenCalledWith(expect.objectContaining(
|
expect(globalMethods.callHttpClient).toHaveBeenCalledWith(expect.objectContaining(
|
||||||
{
|
{
|
||||||
method: endpoints.SaveSession.method,
|
|
||||||
endpoint: endpoints.SaveSession.url,
|
|
||||||
payload: expect.objectContaining({
|
payload: expect.objectContaining({
|
||||||
order: expect.objectContaining({
|
|
||||||
damage: expect.objectContaining({
|
damage: expect.objectContaining({
|
||||||
glassToReplace: []
|
glassToReplace: []
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
it('glassArray empty => empty list', async () => {
|
it('glassArray empty => empty list', async () => {
|
||||||
|
|
@ -924,16 +900,12 @@ describe('Store', () => {
|
||||||
// Asserts
|
// Asserts
|
||||||
expect(globalMethods.callHttpClient).toHaveBeenCalledWith(expect.objectContaining(
|
expect(globalMethods.callHttpClient).toHaveBeenCalledWith(expect.objectContaining(
|
||||||
{
|
{
|
||||||
method: endpoints.SaveSession.method,
|
|
||||||
endpoint: endpoints.SaveSession.url,
|
|
||||||
payload: expect.objectContaining({
|
payload: expect.objectContaining({
|
||||||
order: expect.objectContaining({
|
|
||||||
damage: expect.objectContaining({
|
damage: expect.objectContaining({
|
||||||
glassToReplace: []
|
glassToReplace: []
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
it('Nonempty glass array => expected glass array sent', async () => {
|
it('Nonempty glass array => expected glass array sent', async () => {
|
||||||
|
|
@ -953,10 +925,7 @@ describe('Store', () => {
|
||||||
// Asserts
|
// Asserts
|
||||||
expect(globalMethods.callHttpClient).toHaveBeenCalledWith(expect.objectContaining(
|
expect(globalMethods.callHttpClient).toHaveBeenCalledWith(expect.objectContaining(
|
||||||
{
|
{
|
||||||
method: endpoints.SaveSession.method,
|
|
||||||
endpoint: endpoints.SaveSession.url,
|
|
||||||
payload: expect.objectContaining({
|
payload: expect.objectContaining({
|
||||||
order: expect.objectContaining({
|
|
||||||
damage: expect.objectContaining({
|
damage: expect.objectContaining({
|
||||||
glassToReplace: expect.arrayContaining([
|
glassToReplace: expect.arrayContaining([
|
||||||
{location: location1, name: name1},
|
{location: location1, name: name1},
|
||||||
|
|
@ -965,7 +934,6 @@ describe('Store', () => {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
it('api call throws exception', async () => {
|
it('api call throws exception', async () => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue