Skip to content

Commit acbba7c

Browse files
committed
test(input-otp): use script pattern in e2e test
1 parent ff4bb55 commit acbba7c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

core/src/components/input-otp/test/basic/input-otp.e2e.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ configs({ modes: ['ios'] }).forEach(({ title, config }) => {
262262
});
263263

264264
test('should accept only Cyrillic characters when pattern is set', async ({ page }) => {
265-
await page.setContent(`<ion-input-otp type="text" pattern="[А-Яа-я]">Description</ion-input-otp>`, config);
265+
await page.setContent(`<ion-input-otp type="text" pattern="[\\p{Script=Cyrillic}]">Description</ion-input-otp>`, config);
266266

267267
const inputOtp = page.locator('ion-input-otp');
268268
const firstInput = page.locator('ion-input-otp input').first();
@@ -275,7 +275,7 @@ configs({ modes: ['ios'] }).forEach(({ title, config }) => {
275275

276276
test('should accept only Chinese characters when pattern is set', async ({ page }) => {
277277
await page.setContent(
278-
`<ion-input-otp type="text" pattern="[\\u4e00-\\u9fff]">Description</ion-input-otp>`,
278+
`<ion-input-otp type="text" pattern="[\\p{Script=Han}]">Description</ion-input-otp>`,
279279
config
280280
);
281281

@@ -290,7 +290,7 @@ configs({ modes: ['ios'] }).forEach(({ title, config }) => {
290290

291291
test('should accept only Japanese characters when pattern is set', async ({ page }) => {
292292
await page.setContent(
293-
`<ion-input-otp type="text" pattern="[\\u3040-\\u309F\\u30A0-\\u30FF]">Description</ion-input-otp>`,
293+
`<ion-input-otp type="text" pattern="\\p{Script=Hiragana}">Description</ion-input-otp>`,
294294
config
295295
);
296296

@@ -305,7 +305,7 @@ configs({ modes: ['ios'] }).forEach(({ title, config }) => {
305305

306306
test('should accept only Korean characters when pattern is set', async ({ page }) => {
307307
await page.setContent(
308-
`<ion-input-otp type="text" pattern="[\\uAC00-\\uD7AF\\u1100-\\u11FF]">Description</ion-input-otp>`,
308+
`<ion-input-otp type="text" pattern="\\p{Script=Hangul}">Description</ion-input-otp>`,
309309
config
310310
);
311311

@@ -320,7 +320,7 @@ configs({ modes: ['ios'] }).forEach(({ title, config }) => {
320320

321321
test('should accept only Arabic characters when pattern is set', async ({ page }) => {
322322
await page.setContent(
323-
`<ion-input-otp type="text" pattern="[\\u0600-\\u06FF]">Description</ion-input-otp>`,
323+
`<ion-input-otp type="text" pattern="\\p{Script=Arabic}">Description</ion-input-otp>`,
324324
config
325325
);
326326

0 commit comments

Comments
 (0)