Skip to content

Commit

Permalink
test: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
DavideMininni-Fincons committed Nov 23, 2023
1 parent 61da6c0 commit 6e3ff41
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 34 deletions.
8 changes: 3 additions & 5 deletions src/components/autocomplete/autocomplete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,9 @@ export class SbbAutocomplete extends LitElement {
}
this._syncNegative();

this.addEventListener(
'option-selection-change',
(e: CustomEvent) => this._onOptionSelected(e),
{ signal },
);
this.addEventListener('optionSelectionChange', (e: CustomEvent) => this._onOptionSelected(e), {
signal,
});
this.addEventListener('click', (e) => this._onOptionClick(e), { signal });
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,8 @@ export class SbbDatepickerToggle extends LitElement {
${ref((el: SbbTooltipTrigger) => (this._triggerElement = el))}
></sbb-tooltip-trigger>
<sbb-tooltip
@will-open=${() => this._calendarElement.resetPosition()}
@did-open=${() => {
@willOpen=${() => this._calendarElement.resetPosition()}
@didOpen=${() => {
sbbInputModalityDetector.mostRecentModality === 'keyboard' &&
this._calendarElement.focus();
}}
Expand Down
6 changes: 3 additions & 3 deletions src/components/form-field/form-field/form-field.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ export class SbbFormField extends LitElement {
public override connectedCallback(): void {
super.connectedCallback();
const signal = this._abort.signal;
this.addEventListener('will-open', (e) => this._onPopupOpen(e), { signal });
this.addEventListener('did-close', (e) => this._onPopupClose(e), { signal });
this.addEventListener('willOpen', (e) => this._onPopupOpen(e), { signal });
this.addEventListener('didClose', (e) => this._onPopupClose(e), { signal });
this._handlerRepository.connect();
this._registerInputListener();
this._syncNegative();
Expand Down Expand Up @@ -319,7 +319,7 @@ export class SbbFormField extends LitElement {
let inputFocusElement = this._input;

if (this._input.tagName === 'SBB-SELECT') {
this._input.addEventListener('state-change', () => this._checkAndUpdateInputEmpty(), {
this._input.addEventListener('stateChange', () => this._checkAndUpdateInputEmpty(), {
signal: this._inputAbortController.signal,
});

Expand Down
12 changes: 6 additions & 6 deletions src/components/menu/menu/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ to identify which actions are active and which are not.

## Events

| Name | Type | Description | Inherited From |
| ------------ | ------------------- | ------------------------------------------------------------ | -------------- |
| `will-open` | `CustomEvent<void>` | Emits whenever the `sbb-menu` starts the opening transition. | |
| `did-open` | `CustomEvent<void>` | Emits whenever the `sbb-menu` is opened. | |
| `will-close` | `CustomEvent<void>` | Emits whenever the `sbb-menu` begins the closing transition. | |
| `did-close` | `CustomEvent<void>` | Emits whenever the `sbb-menu` is closed. | |
| Name | Type | Description | Inherited From |
| ----------- | ------------------- | ------------------------------------------------------------ | -------------- |
| `willOpen` | `CustomEvent<void>` | Emits whenever the `sbb-menu` starts the opening transition. | |
| `didOpen` | `CustomEvent<void>` | Emits whenever the `sbb-menu` is opened. | |
| `willClose` | `CustomEvent<void>` | Emits whenever the `sbb-menu` begins the closing transition. | |
| `didClose` | `CustomEvent<void>` | Emits whenever the `sbb-menu` is closed. | |

## Slots

Expand Down
12 changes: 6 additions & 6 deletions src/components/navigation/navigation/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,12 @@ Similarly, if a navigation action is marked to indicate a selected option (e.g.,

## Events

| Name | Type | Description | Inherited From |
| ------------ | ------------------- | ------------------------------------------------------------------ | -------------- |
| `will-open` | `CustomEvent<void>` | Emits whenever the `sbb-navigation` begins the opening transition. | |
| `did-open` | `CustomEvent<void>` | Emits whenever the `sbb-navigation` is opened. | |
| `will-close` | `CustomEvent<void>` | Emits whenever the `sbb-navigation` begins the closing transition. | |
| `did-close` | `CustomEvent<void>` | Emits whenever the `sbb-navigation` is closed. | |
| Name | Type | Description | Inherited From |
| ----------- | ------------------- | ------------------------------------------------------------------ | -------------- |
| `willOpen` | `CustomEvent<void>` | Emits whenever the `sbb-navigation` begins the opening transition. | |
| `didOpen` | `CustomEvent<void>` | Emits whenever the `sbb-navigation` is opened. | |
| `willClose` | `CustomEvent<void>` | Emits whenever the `sbb-navigation` begins the closing transition. | |
| `didClose` | `CustomEvent<void>` | Emits whenever the `sbb-navigation` is closed. | |

## Slots

Expand Down
12 changes: 6 additions & 6 deletions src/components/notification/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,12 @@ For example, use `--sbb-notification-margin: 0 0 var(--sbb-spacing-fixed-4x) 0`

## Events

| Name | Type | Description | Inherited From |
| ------------ | ------------------- | -------------------------------------------------------------------- | -------------- |
| `will-open` | `CustomEvent<void>` | Emits whenever the `sbb-notification` starts the opening transition. | |
| `did-open` | `CustomEvent<void>` | Emits whenever the `sbb-notification` is opened. | |
| `will-close` | `CustomEvent<void>` | Emits whenever the `sbb-notification` begins the closing transition. | |
| `did-close` | `CustomEvent<void>` | Emits whenever the `sbb-notification` is closed. | |
| Name | Type | Description | Inherited From |
| ----------- | ------------------- | -------------------------------------------------------------------- | -------------- |
| `willOpen` | `CustomEvent<void>` | Emits whenever the `sbb-notification` starts the opening transition. | |
| `didOpen` | `CustomEvent<void>` | Emits whenever the `sbb-notification` is opened. | |
| `willClose` | `CustomEvent<void>` | Emits whenever the `sbb-notification` begins the closing transition. | |
| `didClose` | `CustomEvent<void>` | Emits whenever the `sbb-notification` is closed. | |

## Slots

Expand Down
8 changes: 4 additions & 4 deletions src/components/option/option/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ If the label slot contains only a **text node**, it is possible to search for te

## Events

| Name | Type | Description | Inherited From |
| ------------------------- | ------------------- | ----------------------------------------------- | -------------- |
| `option-selection-change` | `CustomEvent<void>` | Emits when the option selection status changes. | |
| `option-selected` | `CustomEvent<void>` | Emits when an option was selected by user. | |
| Name | Type | Description | Inherited From |
| ----------------------- | ------------------- | ----------------------------------------------- | -------------- |
| `optionSelectionChange` | `CustomEvent<void>` | Emits when the option selection status changes. | |
| `optionSelected` | `CustomEvent<void>` | Emits when an option was selected by user. | |

## Slots

Expand Down
2 changes: 1 addition & 1 deletion src/components/select/select.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ export class SbbSelect extends LitElement {
this._onValueChanged(this.value);
}

this.addEventListener('option-selection-change', (e) => this._onOptionChanged(e), { signal });
this.addEventListener('optionSelectionChange', (e) => this._onOptionChanged(e), { signal });
this.addEventListener(
'click',
(e) => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/tabs/tab-group/tab-group.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ describe('sbb-tab-group', () => {

it('dispatches event on tab change', async () => {
const tab = document.querySelector('sbb-tab-group > sbb-tab-title#sbb-tab-1') as SbbTabTitle;
const changeSpy = new EventSpy('did-change');
const changeSpy = new EventSpy('didChange');

tab.click();
await waitForCondition(() => changeSpy.events.length === 1);
Expand Down

0 comments on commit 6e3ff41

Please sign in to comment.