Add test for vin-lookup
This commit is contained in:
parent
b5749eb8aa
commit
6b62095cf5
2 changed files with 15 additions and 1 deletions
|
|
@ -242,6 +242,19 @@ describe("vin-lookup.vue", () => {
|
||||||
// Assert
|
// Assert
|
||||||
expect(wrapper.findAllComponents({ name: "alert" }).length).toBe(0);
|
expect(wrapper.findAllComponents({ name: "alert" }).length).toBe(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test.only("Error emitted by textbox-question element => VinScanFailed alert shown.", async () => {
|
||||||
|
// Arrange
|
||||||
|
const { wrapper } = setupMocks({});
|
||||||
|
|
||||||
|
// Act
|
||||||
|
const vinLookup = wrapper.findComponent('[data-test="vin-lookup-component"]');
|
||||||
|
vinLookup.trigger('imageLookupError');
|
||||||
|
await wrapper.vm.$nextTick();
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
expect(wrapper.findAllComponents({ name: "alert" }).length).toBe(1);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,8 @@
|
||||||
maxLength="17"
|
maxLength="17"
|
||||||
includeCameraIcon
|
includeCameraIcon
|
||||||
:mask="vinMask"
|
:mask="vinMask"
|
||||||
@image-lookup-error="displayVinScanAlert" />
|
@image-lookup-error="displayVinScanAlert"
|
||||||
|
data-test="vin-lookup-field" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row mb-2">
|
<div class="row mb-2">
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue