Skip to content

Commit f4d910a

Browse files
committed
chore(core): update lighthouse
Signed-off-by: Cory Rylan <crylan@nvidia.com>
1 parent ae2095f commit f4d910a

5 files changed

Lines changed: 28 additions & 8 deletions

File tree

‎projects/core/src/notification/notification.test.lighthouse.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ describe('notification lighthouse report', () => {
1717
expect(report.scores.performance).toBe(100);
1818
expect(report.scores.accessibility).toBe(100);
1919
expect(report.scores.bestPractices).toBe(100);
20-
expect(report.payload.javascript.kb).toBeLessThan(25.9);
20+
expect(report.payload.javascript.kb).toBeLessThan(26);
2121
});
2222
});

‎projects/core/src/resize-handle/resize-handle.test.lighthouse.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ describe('resize-handle lighthouse report', () => {
1616
expect(report.scores.performance).toBe(100);
1717
expect(report.scores.accessibility).toBe(100);
1818
expect(report.scores.bestPractices).toBe(100);
19-
expect(report.payload.javascript.kb).toBeLessThan(15.5);
19+
expect(report.payload.javascript.kb).toBeLessThan(15.6);
2020
});
2121
});

‎projects/core/src/tree/tree.test.lighthouse.ts‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ describe('tree lighthouse report', () => {
3030
expect(report.scores.performance).toBe(100);
3131
expect(report.scores.accessibility).toBe(100);
3232
expect(report.scores.bestPractices).toBe(100);
33-
// Allow a small margin above measured local and CI payloads.
34-
expect(report.payload.javascript.kb).toBeLessThanOrEqual(30.6);
33+
expect(report.payload.javascript.kb).toBeLessThan(30.7);
3534
});
3635
});

‎projects/media/src/pip-button/pip-button.test.ts‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,23 @@ describe(MediaPipButton.metadata.tag, () => {
4040
expect(button.tabIndex).toBe(0);
4141
});
4242

43+
it('should sync pressed and type through inherited setters', async () => {
44+
button.pressed = true;
45+
expect(button.hasAttribute('pressed')).toBe(true);
46+
button.removeAttribute('pressed');
47+
expect(button.pressed).toBe(false);
48+
button.setAttribute('pressed', '');
49+
expect(button.pressed).toBe(true);
50+
51+
button.type = 'submit';
52+
expect(button.getAttribute('type')).toBe('submit');
53+
button.setAttribute('type', 'reset');
54+
expect(button.type).toBe('reset');
55+
button.type = 'button';
56+
expect(button.getAttribute('type')).toBe('button');
57+
await elementIsStable(button);
58+
});
59+
4360
it('should send the toggle command without changing pressed state optimistically', async () => {
4461
const event = untilEvent<Event & { command: string; source: HTMLElement }>(target, 'command');
4562
await emulateClick(button);

‎projects/media/src/pip-button/pip-button.ts‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import { property } from 'lit/decorators/property.js';
55
import type { PropertyValues } from 'lit';
66
import { html, LitElement } from 'lit';
7-
import { ButtonFormControlMixin, type ButtonType } from '@nvidia-elements/forms/mixins';
7+
import { ButtonFormControlMixin } from '@nvidia-elements/forms/mixins';
88
import { attachInternals, I18nController, scopedRegistry, useStyles } from '@nvidia-elements/core/internal';
99
import { Icon } from '@nvidia-elements/core/icon';
1010
import { MediaStateController } from '../internal/controllers/media-state.controller.js';
@@ -46,9 +46,7 @@ export class MediaPipButton extends ButtonFormControlMixin(LitElement) {
4646

4747
override command: string = mediaCommands.togglePip;
4848

49-
override type: ButtonType = 'button';
50-
51-
@property({ type: Boolean, reflect: true }) pressed = false;
49+
@property({ type: Boolean, reflect: true, noAccessor: true }) declare pressed: boolean;
5250

5351
#pipAvailable = false;
5452

@@ -67,6 +65,12 @@ export class MediaPipButton extends ButtonFormControlMixin(LitElement) {
6765

6866
#mediaStateController = new MediaStateController(this, mediaState => this.#syncMediaState(mediaState));
6967

68+
constructor() {
69+
super();
70+
this.type = 'button';
71+
this.pressed = false;
72+
}
73+
7074
render() {
7175
return html`
7276
<div internal-host interaction-state focus-within aria-hidden="true">

0 commit comments

Comments
 (0)