[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: tests.js
// swal() sould add the modal to the DOM + make it visible test("modal shows up", function() { equal($('.sweet-alert').length, 0); swal("Hello world!"); ok($('.sweet-alert').is(':visible')); }); // Clicking the confirm-button should dismiss the modal test("dismiss modal with confirm-button", function(assert) { var done = assert.async(); swal("Dismiss me"); var $modal = $('.sweet-alert'); $modal.find('button.confirm').click(); setTimeout(function() { assert.ok($modal.is(':hidden')); done(); }, 500); }); test("dismiss modal with esc-key", function(assert) { var done = assert.async(); swal("Dismiss me"); var $modal = $('.sweet-alert'); $(document).trigger($.Event('keydown', { keyCode: 27 })); setTimeout(function() { assert.ok($modal.is(':hidden')); done(); }, 500); }); test("modals stays on with esc-key if allowEscapeKey is false", function(assert) { var done = assert.async(); swal({ title: "Dismiss me", allowEscapeKey: false }); var $modal = $('.sweet-alert'); $(document).trigger($.Event('keydown', { keyCode: 27 })); setTimeout(function() { assert.ok($modal.is(':visible')); done(); }, 500); }); /* * Make sure that when using { showCancelButton: true }: * - The cancel-button is visible on the modal * - Clicking on it dismisses the modal */ test("cancel-button works", function(assert) { var done = assert.async(); swal({ title: "Test", showCancelButton: true }); var $modal = $('.sweet-alert'); var $cancelBtn = $modal.find('button.cancel'); ok($cancelBtn.is(':visible')); $cancelBtn.click(); setTimeout(function() { assert.ok($modal.is(':hidden')); done(); }, 500); }); // Clicking the overlay should not dismiss the modal... test("clicking the overlay does not dismiss modal", function(assert) { var done = assert.async(); swal("Test"); var $modal = $('.sweet-alert'); $('.sweet-overlay').click(); setTimeout(function() { assert.ok($modal.is(':visible')); done(); }, 500); }); // ...except if we pass allowOutsideClick: true test("clicking the overlay (with allowOutsideClick option) dismisses modal", function(assert) { var done = assert.async(); swal({ title: "Test", allowOutsideClick: true }); var $modal = $('.sweet-alert'); $('.sweet-overlay').click(); setTimeout(function() { assert.ok($modal.is(':hidden')); done(); }, 500); }); test("timer works", function(assert) { var done = assert.async(); swal({ title: "Timer test", showConfirmButton: false, timer: 500 }); var $modal = $('.sweet-alert'); assert.ok($modal.find('button.cancel, button.confirm').is(':hidden')); setTimeout(function() { assert.ok($modal.is(':hidden')); done(); }, 1000); }); test("prompt functionality works", function() { swal({ title: "Prompt test", type: "input", inputPlaceholder: "Placeholder text" }); var $modal = $('.sweet-alert'); ok($modal.find('fieldset input').is(':visible')); equal($modal.find('fieldset input').attr('placeholder'), "Placeholder text"); });
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server05.hostinghome.co.in
Server IP: 192.168.74.40
PHP Version: 7.4.33
Server Software: Apache
System: Linux server05.hostinghome.co.in 3.10.0-962.3.2.lve1.5.81.el7.x86_64 #1 SMP Wed May 31 10:36:47 UTC 2023 x86_64
HDD Total: 1.95 TB
HDD Free: 677.97 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Disabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes
gcc:
Yes
pkexec:
No
git:
Yes
User Info
Username: itsweb
User ID (UID): 1619
Group ID (GID): 1621
Script Owner UID: 1619
Current Dir Owner: 1619