diff --git a/scripts/alerts/alert.js b/scripts/alerts/alert.js index 53d86e4d4..c770703a5 100644 --- a/scripts/alerts/alert.js +++ b/scripts/alerts/alert.js @@ -54,9 +54,9 @@ export class AlertController { * - The use of `.innerHTML` allows for input styling at this cost. * @param {'success'|'info'|'warning'} type - The alert level * @param {string} message - The message to relay to the user - * @param {number?} timeout - The time in `ms` until the alert expires (Defaults to never expiring) + * @param {number?} timeout - The time in `ms` until the alert expires */ - createAlert(level, message, timeout = 2000) { + createAlert(level, message, timeout = 10000) { this.addAlert(new Alert({ level, message, timeout })); } @@ -93,9 +93,9 @@ export class AlertController { * - The use of `.innerHTML` allows for input styling at this cost. * @param {'success'|'info'|'warning'} type - The alert level * @param {string} message - The message to relay to the user - * @param {number?} [timeout] - The time in `ms` until the alert expires (Defaults to never expiring) + * @param {number?} [timeout] - The time in `ms` until the alert expires */ -export function createAlert(type, message, timeout = 0) { +export function createAlert(type, message, timeout) { const alertController = AlertController.getInstance(); return alertController.createAlert(type, message, timeout); } diff --git a/tests/unit/alert.spec.js b/tests/unit/alert.spec.js index 1b7134ee6..8c1612faa 100644 --- a/tests/unit/alert.spec.js +++ b/tests/unit/alert.spec.js @@ -75,7 +75,7 @@ describe('createAlert function', () => { const level = 'info'; createAlert(level, message); - expect(createAlertSpy).toHaveBeenCalledWith(level, message, 0); + expect(createAlertSpy).toHaveBeenCalledWith(level, message, undefined); createAlertSpy.mockRestore(); });