Skip to content

Commit 8a0312f

Browse files
authored
Merge branch 'main' into gh-26915
2 parents eb23f85 + 2c68d01 commit 8a0312f

File tree

4 files changed

+40
-13
lines changed

4 files changed

+40
-13
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { newSpecPage } from '@stencil/core/testing';
2+
import { Input } from '../input';
3+
4+
it('should inherit attributes', async () => {
5+
const page = await newSpecPage({
6+
components: [Input],
7+
html: '<ion-input title="my title" tabindex="-1" data-form-type="password"></ion-input>',
8+
});
9+
10+
const nativeEl = page.body.querySelector('ion-input input');
11+
expect(nativeEl.getAttribute('title')).toBe('my title');
12+
expect(nativeEl.getAttribute('tabindex')).toBe('-1');
13+
expect(nativeEl.getAttribute('data-form-type')).toBe('password');
14+
});

core/src/components/ripple-effect/test/basic/ripple-effect.e2e.ts

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,12 @@ import { expect } from '@playwright/test';
22
import type { E2EPage } from '@utils/test/playwright';
33
import { test } from '@utils/test/playwright';
44

5-
// TODO FW-3081
6-
test.describe.skip('ripple-effect: basic', () => {
5+
test.describe('ripple-effect: basic', () => {
6+
test.beforeEach(async ({ skip }) => {
7+
skip.rtl();
8+
skip.mode('ios');
9+
});
10+
711
test('should add .ion-activated when pressed', async ({ page }) => {
812
await verifyRippleEffect(page, '#small-btn');
913
await verifyRippleEffect(page, '#large-btn');
@@ -14,7 +18,7 @@ test.describe.skip('ripple-effect: basic', () => {
1418

1519
test.describe('ripple effect with nested ion-button', () => {
1620
test('should add .ion-activated when the block is pressed', async ({ page }) => {
17-
await page.goto(`/src/components/ripple-effect/test/basic?ionic:_testing=false&ionic:mode=md`);
21+
await page.goto('/src/components/ripple-effect/test/basic?ionic:_testing=false');
1822

1923
const el = page.locator('#ripple-with-button');
2024

@@ -30,9 +34,7 @@ test.describe.skip('ripple-effect: basic', () => {
3034
// Waits for the ripple effect to be added
3135
await page.waitForSelector('.ion-activated');
3236

33-
const elHandle = await el.elementHandle();
34-
const classes = await elHandle?.evaluate((el) => el.classList.value);
35-
expect(classes).toMatch(/ion-activated/);
37+
await expect(el).toHaveClass(/ion-activated/);
3638
});
3739

3840
test('should add .ion-activated when the button is pressed', async ({ page }) => {
@@ -42,7 +44,7 @@ test.describe.skip('ripple-effect: basic', () => {
4244
});
4345

4446
const verifyRippleEffect = async (page: E2EPage, selector: string) => {
45-
await page.goto(`/src/components/ripple-effect/test/basic?ionic:_testing=false&ionic:mode=md`);
47+
await page.goto('/src/components/ripple-effect/test/basic?ionic:_testing=false');
4648

4749
const el = page.locator(selector);
4850

@@ -55,10 +57,7 @@ const verifyRippleEffect = async (page: E2EPage, selector: string) => {
5557
await page.mouse.down();
5658
}
5759

58-
// Waits for the ripple effect to be added
59-
await page.waitForSelector(`${selector}.ion-activated`);
60+
await page.waitForSelector('.ion-activated');
6061

61-
const elHandle = await el.elementHandle();
62-
const classes = await elHandle?.evaluate((el) => el.classList.value);
63-
expect(classes).toMatch(/ion-activated/);
62+
await expect(el).toHaveClass(/ion-activated/);
6463
};
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { newSpecPage } from '@stencil/core/testing';
2+
import { Textarea } from '../textarea';
3+
4+
it('should inherit attributes', async () => {
5+
const page = await newSpecPage({
6+
components: [Textarea],
7+
html: '<ion-textarea title="my title" tabindex="-1" data-form-type="password"></ion-textarea>',
8+
});
9+
10+
const nativeEl = page.body.querySelector('ion-textarea textarea');
11+
expect(nativeEl.getAttribute('title')).toBe('my title');
12+
expect(nativeEl.getAttribute('tabindex')).toBe('-1');
13+
expect(nativeEl.getAttribute('data-form-type')).toBe('password');
14+
});

core/src/components/textarea/textarea.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ export class Textarea implements ComponentInterface {
223223
componentWillLoad() {
224224
this.inheritedAttributes = {
225225
...inheritAriaAttributes(this.el),
226-
...inheritAttributes(this.el, ['data-form-type', 'title']),
226+
...inheritAttributes(this.el, ['data-form-type', 'title', 'tabindex']),
227227
};
228228
}
229229

0 commit comments

Comments
 (0)