| Server IP : 94.136.191.34 / Your IP : 216.73.216.25 Web Server : Apache System : Linux hostpanel.netbiz.in 5.15.0-130-generic #140-Ubuntu SMP Wed Dec 18 17:59:53 UTC 2024 x86_64 User : omkar.com_6nnuz6y629h ( 10087) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system,proc_open,popen MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/vhosts/omkar.com/httpdocs/assets/build/src/spec/tests/methods/ |
Upload File : |
"use strict";
describe("destroy: init plugin to test public method destroy", function() {
beforeEach(function() {
intlSetup();
input = $("<input>");
input.intlTelInput();
});
afterEach(function() {
input = null;
});
it("adds the markup", function() {
expect(getParentElement()).toHaveClass("intl-tel-input");
expect(getSelectedFlagContainer()).toExist();
expect(getListElement()).toExist();
});
it("binds the events listeners", function() {
var listeners = $._data(input[0], 'events');
expect("cut" in listeners).toBeTruthy();
expect("paste" in listeners).toBeTruthy();
expect("keyup" in listeners).toBeTruthy();
});
describe("calling destroy", function() {
beforeEach(function() {
input.intlTelInput("destroy");
});
it("removes the markup", function() {
expect(getParentElement()).not.toHaveClass("intl-tel-input");
expect(getSelectedFlagContainer()).not.toExist();
expect(getListElement()).not.toExist();
});
it("unbinds the event listeners", function() {
var listeners = $._data(input[0], 'events');
expect(listeners).toBeUndefined();
});
});
});
describe("destroy: init plugin with nationalMode=false and autoHideDialCode=true", function() {
beforeEach(function() {
intlSetup();
input = $("<input>");
input.intlTelInput({
nationalMode: false,
autoHideDialCode: true
});
});
afterEach(function() {
input = null;
});
it("binds the events listeners", function() {
var listeners = $._data(input[0], 'events');
expect("blur" in listeners).toBeTruthy();
expect("focus" in listeners).toBeTruthy();
expect("mousedown" in listeners).toBeTruthy();
});
describe("calling destroy", function() {
beforeEach(function() {
input.intlTelInput("destroy");
});
it("unbinds the event listeners", function() {
var listeners = $._data(input[0], 'events');
expect(listeners).toBeUndefined();
});
});
});