Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions angular/demo/bootstrap/src/app/samples/alert/config.route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export default class ConfigAlertComponent {
readonly dismissible = signal(true);
readonly type = signal(this.styleList[0].value);

showAlert(alert: AlertComponent) {
alert.api.open();
async showAlert(alert: AlertComponent) {
await alert.api.open();
}
}
8 changes: 4 additions & 4 deletions core/src/components/alert/alert.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe(`Alert`, () => {
test(`should close on method call`, () => {
const expectedState = state;
expect(expectedState.visible).toBe(true);
alert.api.close();
void alert.api.close();
expectedState.visible = false;
expectedState.hidden = true;
expect(state).toEqual(expectedState);
Expand All @@ -38,7 +38,7 @@ describe(`Alert`, () => {
alert.patch({visible: false});
const expectedState = state;
expect(expectedState.visible).toBe(false);
alert.api.open();
void alert.api.open();
expectedState.visible = true;
expectedState.hidden = false;
expect(state).toEqual(expectedState);
Expand Down Expand Up @@ -71,13 +71,13 @@ describe(`Alert`, () => {
});
alertEvents.directives.transitionDirective(element);

alertEvents.api.close();
void alertEvents.api.close();
await promiseOnHidden.promise;
expect(onVisibleChangeCounter).toBe(1);
expect(onShownCounter).toBe(0);
expect(onHiddenCounter).toBe(1);

alertEvents.api.open();
void alertEvents.api.open();
await promiseOnShown.promise;
expect(onVisibleChangeCounter).toBe(2);
expect(onShownCounter).toBe(1);
Expand Down
8 changes: 4 additions & 4 deletions core/src/components/alert/common.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe(`Common Alert`, () => {
test(`should close on method call`, () => {
const expectedState = state;
expect(expectedState.visible).toBe(true);
commonAlert.api.close();
void commonAlert.api.close();
expectedState.visible = false;
expectedState.hidden = true;
expect(state).toEqual(expectedState);
Expand All @@ -38,7 +38,7 @@ describe(`Common Alert`, () => {
commonAlert.patch({visible: false});
const expectedState = state;
expect(expectedState.visible).toBe(false);
commonAlert.api.open();
void commonAlert.api.open();
expectedState.visible = true;
expectedState.hidden = false;
expect(state).toEqual(expectedState);
Expand Down Expand Up @@ -71,13 +71,13 @@ describe(`Common Alert`, () => {
});
alertEvents.directives.transitionDirective(element);

alertEvents.api.close();
void alertEvents.api.close();
await promiseOnHidden.promise;
expect(onVisibleChangeCounter).toBe(1);
expect(onShownCounter).toBe(0);
expect(onHiddenCounter).toBe(1);

alertEvents.api.open();
void alertEvents.api.open();
await promiseOnShown.promise;
expect(onVisibleChangeCounter).toBe(2);
expect(onShownCounter).toBe(1);
Expand Down
4 changes: 2 additions & 2 deletions core/src/components/alert/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,12 @@ export interface CommonAlertApi {
/**
* Triggers alert closing programmatically (same as clicking on the close button (×)).
*/
close(): void;
close(): Promise<void>;

/**
* Triggers the alert to be displayed for the user.
*/
open(): void;
open(): Promise<void>;
}

/**
Expand Down
6 changes: 3 additions & 3 deletions core/src/components/collapse/collapse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,17 +103,17 @@ export interface CollapseApi {
/**
* Triggers collapse closing programmatically.
*/
close(): void;
close(): Promise<void>;

/**
* Triggers the collapse content to be displayed for the user.
*/
open(): void;
open(): Promise<void>;

/**
* Toggles the collapse content visibility.
*/
toggle(): void;
toggle(): Promise<void>;
}

/**
Expand Down
8 changes: 4 additions & 4 deletions core/src/components/toast/toast.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe(`Toast`, () => {
test(`should close on method call`, () => {
const expectedState = state;
expect(expectedState.visible).toBe(true);
toast.api.close();
void toast.api.close();
expect(state).toEqual(
assign(expectedState, {
visible: false,
Expand All @@ -44,7 +44,7 @@ describe(`Toast`, () => {
toast.patch({visible: false});
const expectedState = state;
expect(expectedState.visible).toBe(false);
toast.api.open();
void toast.api.open();
expect(state).toEqual(
assign(expectedState, {
visible: true,
Expand Down Expand Up @@ -80,13 +80,13 @@ describe(`Toast`, () => {
});
toastEvents.directives.transitionDirective(element);

toastEvents.api.close();
void toastEvents.api.close();
await promiseOnHidden.promise;
expect(onVisibleChangeCounter).toBe(1);
expect(onShownCounter).toBe(0);
expect(onHiddenCounter).toBe(1);

toastEvents.api.open();
void toastEvents.api.open();
await promiseOnShown.promise;
expect(onVisibleChangeCounter).toBe(2);
expect(onShownCounter).toBe(1);
Expand Down
4 changes: 2 additions & 2 deletions react/demo/src/bootstrap/samples/toast/Action.route.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import {useRef} from 'react';
const ActionToastDemo = () => {
const refToast = useRef<ToastApi>(null);

function reset() {
refToast.current?.open();
async function reset() {
await refToast.current?.open();
}

return (
Expand Down
4 changes: 2 additions & 2 deletions react/demo/src/bootstrap/samples/toast/Default.route.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import {useRef} from 'react';

const DefaultToastDemo = () => {
const refToast = useRef<ToastApi>(null);
function reset() {
refToast.current!.open();
async function reset() {
await refToast.current!.open();
}

return (
Expand Down
Loading