Skip to content

Commit 14cf21b

Browse files
authored
test: re-enabling and fixing the tests for PhoneInput (#183)
Author: @lloydaf
1 parent cfcf138 commit 14cf21b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/components/PhoneInput/PhoneInput.spec.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const selectOption = async (currentValueText: string, selectOptionText: string)
1212
//
1313
// I disabled the tests for now and created an issue to fix this see: https://github.com/freenowtech/wave/issues/27
1414
// eslint-disable-next-line jest/no-disabled-tests
15-
describe.skip('PhoneInput', () => {
15+
describe('PhoneInput', () => {
1616
const defaultCountry = { value: 'DE', label: 'Germany', dialCode: '+49' };
1717

1818
it('should call the country change handler when the user selects a country', async () => {
@@ -35,7 +35,9 @@ describe.skip('PhoneInput', () => {
3535
it('should focus on national number input after selecting a country', async () => {
3636
render(<PhoneInput country={defaultCountry} label="Phone Number" />);
3737

38-
await selectOption(defaultCountry.dialCode, 'Spain (España) +34');
38+
// not all the countries are rendered at one go, they are rendered as you scroll
39+
// so select a country that will come at the top, for example Andorra
40+
await selectOption(defaultCountry.dialCode, 'Andorra +376');
3941

4042
expect(document.activeElement).toEqual(screen.getByLabelText('Phone Number'));
4143
});

0 commit comments

Comments
 (0)