%PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
Server IP : 49.231.201.246 / Your IP : 216.73.216.41 Web Server : Apache/2.4.18 (Ubuntu) System : Linux 246 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64 User : root ( 0) PHP Version : 7.0.33-0ubuntu0.16.04.16 Disable Function : exec,passthru,shell_exec,system,proc_open,popen,pcntl_exec MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/html/ppaobm/vendor/bower-asset/sweetalert2/test/qunit/params/ |
Upload File : |
const { Swal, SwalWithoutAnimation, TIMEOUT } = require('../helpers') const sinon = require('sinon/pkg/sinon') QUnit.test('inputValue number', (assert) => { Swal({ input: 'text', inputValue: 333 }) assert.ok(Swal.getInput().value, '333') }) QUnit.test('inputValue as a Promise', (assert) => { const _consoleWarn = console.warn const spy = sinon.spy(console, 'warn') const inputTypes = ['text', 'email', 'number', 'tel', 'textarea'] const done = assert.async(inputTypes.length) const value = '1.1 input value' const inputValue = new Promise((resolve) => { resolve('1.1 input value') }) inputTypes.forEach(input => { SwalWithoutAnimation({ input, inputValue, onOpen: (modal) => { setTimeout(() => { const inputEl = input === 'textarea' ? modal.querySelector('.swal2-textarea') : modal.querySelector('.swal2-input') assert.equal(inputEl.value, input === 'number' ? parseFloat(value) : value) done() }, TIMEOUT) } }) }) console.warn = _consoleWarn assert.ok(spy.notCalled) }) QUnit.test('should throw console warning about unexpected type of inputValue', (assert) => { const _consoleWarn = console.warn const spy = sinon.spy(console, 'warn') Swal({ input: 'text', inputValue: undefined }) console.warn = _consoleWarn assert.ok(spy.calledWith('SweetAlert2: Unexpected type of inputValue! Expected "string", "number" or "Promise", got "undefined"')) })