Skip to content

Commit 786ea2f

Browse files
committed
review
1 parent ba7ea64 commit 786ea2f

File tree

6 files changed

+13
-15
lines changed

6 files changed

+13
-15
lines changed

src/material-experimental/mdc-chips/harness/chip-grid-harness.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ describe('MatChipGridHarness', () => {
3333

3434
it('should get the chip input harness', async () => {
3535
const harnesses = await loader.getAllHarnesses(MatChipGridHarness);
36-
const input = await harnesses[0].getInput();
36+
const input = await harnesses[0].getTextInput();
3737
expect(await input).not.toBe(null);
3838
});
3939
});

src/material-experimental/mdc-chips/harness/chip-grid-harness.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ export class MatChipGridHarness extends ComponentHarness {
2525
return await this._rows();
2626
}
2727

28-
/** Gets promise of the chip input harness. */
29-
async getInput(): Promise<MatChipInputHarness|null> {
28+
/** Gets promise of the chip text input harness. */
29+
async getTextInput(): Promise<MatChipInputHarness|null> {
3030
return await this._input();
3131
}
3232
}

src/material-experimental/mdc-chips/harness/chip-harness.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ describe('MatChipHarness', () => {
2727

2828
it('should get the chip text content', async () => {
2929
const harnesses = await loader.getAllHarnesses(MatChipHarness);
30-
expect(await harnesses[0].getTextContent()).toBe('Basic Chip');
31-
expect(await harnesses[1].getTextContent()).toBe('Chip');
32-
expect(await harnesses[2].getTextContent()).toBe('Disabled Chip');
30+
expect(await harnesses[0].getText()).toBe('Basic Chip');
31+
expect(await harnesses[1].getText()).toBe('Chip');
32+
expect(await harnesses[2].getText()).toBe('Disabled Chip');
3333
});
3434

3535
it('should get the disabled state', async () => {

src/material-experimental/mdc-chips/harness/chip-harness.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,12 @@ export class MatChipHarness extends ComponentHarness {
1616
static hostSelector = 'mat-basic-chip, mat-chip';
1717

1818
/** Gets a promise for the text content the option. */
19-
async getTextContent(): Promise<string> {
19+
async getText(): Promise<string> {
2020
return (await this.host()).text();
2121
}
2222

2323
/** Gets a promise for the disabled state. */
2424
async isDisabled(): Promise<boolean> {
25-
const ariaSelected = (await this.host()).getAttribute('aria-disabled');
26-
return await ariaSelected === 'true';
25+
return await ((await this.host()).getAttribute('aria-disabled')) === 'true';
2726
}
2827
}

src/material-experimental/mdc-chips/harness/chip-input.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,11 @@ import {ComponentHarness} from '@angular/cdk-experimental/testing';
1313
* @dynamic
1414
*/
1515
export class MatChipInputHarness extends ComponentHarness {
16-
static hostSelector = 'input.mat-mdc-chip-input';
16+
static hostSelector = '.mat-mdc-chip-input';
1717

1818
/** Gets a promise for the disabled state. */
1919
async isDisabled(): Promise<boolean> {
20-
const ariaSelected = (await this.host()).getAttribute('disabled');
21-
return await ariaSelected === 'true';
20+
return await ((await this.host()).getAttribute('disabled')) === 'true';
2221
}
2322

2423
/** Gets a promise for the placeholder text. */

src/material-experimental/mdc-chips/harness/chip-listbox-harness.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ describe('MatChipListboxHarness', () => {
4444
const harnesses = await loader.getAllHarnesses(MatChipListboxHarness);
4545
const selectedOption = await harnesses[0].getSelected();
4646
expect(await selectedOption.length).toBe(1);
47-
expect(await selectedOption[0].getTextContent()).toContain('Blue');
47+
expect(await selectedOption[0].getText()).toContain('Blue');
4848
});
4949

5050
it('with multiple selected options', async () => {
@@ -56,8 +56,8 @@ describe('MatChipListboxHarness', () => {
5656
const harnesses = (await loader.getAllHarnesses(MatChipListboxHarness));
5757
const selectedOption = await harnesses[0].getSelected();
5858
expect(await selectedOption.length).toBe(2);
59-
expect(await selectedOption[0].getTextContent()).toContain('Blue');
60-
expect(await selectedOption[1].getTextContent()).toContain('Green');
59+
expect(await selectedOption[0].getText()).toContain('Blue');
60+
expect(await selectedOption[1].getText()).toContain('Green');
6161
});
6262
});
6363
});

0 commit comments

Comments
 (0)