Skip to content

Commit

Permalink
add workaround in acceptance test
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoskolodny committed Sep 25, 2024
1 parent 57066f8 commit 97fe5fe
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/__acceptance_tests__/input-fields-acceptance-test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,12 @@ test.each(STORY_TYPES)('PhoneNumberField (%s)', async (storyType) => {

const field = await screen.findByLabelText('Label');

// TODO: https://jira.tid.es/browse/WEB-2047
// phonenumberlib is loaded lazily, and if we start typing before the lib is fully loaded,
// the test becomes unstable and the final value in the field may be wrong. As a workaround
// we wait some time before typing anything into the field
await new Promise((r) => setTimeout(r, 100));

await clearAndType(page, field, '654834455');
expect(await getValue(field)).toBe('654 83 44 55');

Expand Down

0 comments on commit 97fe5fe

Please sign in to comment.