diff --git a/js/src/toast.js b/js/src/toast.js index 98be2a4187..02596e9dad 100644 --- a/js/src/toast.js +++ b/js/src/toast.js @@ -75,6 +75,10 @@ class Toast { return DefaultType } + static get Default() { + return Default + } + // Public show() { diff --git a/js/tests/unit/toast.js b/js/tests/unit/toast.js index e6bd6be1ee..2081693ebc 100644 --- a/js/tests/unit/toast.js +++ b/js/tests/unit/toast.js @@ -236,4 +236,24 @@ $(function () { }) .bootstrapToast('show') }) + + QUnit.test('should expose default setting to allow to override them', function (assert) { + assert.expect(1) + + var defaultDelay = 1000 + Toast.Default.delay = defaultDelay + + var toastHtml = + '