Skip to content

Commit 47ce621

Browse files
damingerdaicrisbeto
authored andcommitted
test(material/button): use withContext to expact fail output (#24937)
(cherry picked from commit b2e6d7e)
1 parent e0a0ac0 commit 47ce621

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/material/button/button.spec.ts

+12-12
Original file line numberDiff line numberDiff line change
@@ -310,22 +310,22 @@ describe('MatButton', () => {
310310
});
311311

312312
it('should disable the ripple when the button is disabled', () => {
313-
expect(buttonRippleInstance.disabled).toBeFalsy(
314-
'Expected an enabled button[mat-button] to have an enabled ripple',
315-
);
316-
expect(anchorRippleInstance.disabled).toBeFalsy(
317-
'Expected an enabled a[mat-button] to have an enabled ripple',
318-
);
313+
expect(buttonRippleInstance.disabled)
314+
.withContext('Expected an enabled button[mat-button] to have an enabled ripple')
315+
.toBeFalsy();
316+
expect(anchorRippleInstance.disabled)
317+
.withContext('Expected an enabled a[mat-button] to have an enabled ripple')
318+
.toBeFalsy();
319319

320320
testComponent.isDisabled = true;
321321
fixture.detectChanges();
322322

323-
expect(buttonRippleInstance.disabled).toBeTruthy(
324-
'Expected a disabled button[mat-button] not to have an enabled ripple',
325-
);
326-
expect(anchorRippleInstance.disabled).toBeTruthy(
327-
'Expected a disabled a[mat-button] not to have an enabled ripple',
328-
);
323+
expect(buttonRippleInstance.disabled)
324+
.withContext('Expected a disabled button[mat-button] not to have an enabled ripple')
325+
.toBeTruthy();
326+
expect(anchorRippleInstance.disabled)
327+
.withContext('Expected a disabled a[mat-button] not to have an enabled ripple')
328+
.toBeTruthy();
329329
});
330330
});
331331

0 commit comments

Comments
 (0)