Skip to content

Commit

Permalink
fix: #1069 fix a type error (#1094)
Browse files Browse the repository at this point in the history
  • Loading branch information
MCatherine1994 authored Dec 13, 2023
1 parent b7724b5 commit 2efac08
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions frontend/src/tests/ForestClientInput.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,9 @@ describe('ForestClientInput', () => {

it('add success forest client number', async () => {
const input = wrapper.find('#forestClientInput');
const inputField: HTMLInputElement = input.element as HTMLInputElement;
await input.setValue('00000001');
expect(input.element.value).toBe('00000001');
expect(inputField.value).toBe('00000001');

const verifyButton = wrapper.find("[aria-label='Add Client Numbers']");
await verifyButton.trigger('click');
Expand All @@ -74,9 +75,11 @@ describe('ForestClientInput', () => {
// i.e. setVerifiedForestClients = [ [ '00000001' ] ]
// the outter array indicates how many times it has been called
// the inner array indicates how many parameters it has
expect(setVerifiedForestClients[0][0]).toEqual(
TEST_SUCCESS_FOREST_CLIENT_NUMBER
);
expect(
setVerifiedForestClients
? setVerifiedForestClients[0][0]
: undefined
).toEqual(TEST_SUCCESS_FOREST_CLIENT_NUMBER);
// the forest client information card shows and verify the information
expect(wrapper.html().includes('Verified Client ID information')).toBe(
true
Expand All @@ -97,6 +100,6 @@ describe('ForestClientInput', () => {
wrapper.find('.org-status-wrapper').text().includes('Active')
).toBe(true);
// the forest client input should now be empty
expect(input.element.value).toBe('');
expect(inputField.value).toBe('');
});
});

0 comments on commit 2efac08

Please sign in to comment.