intl-tel-input
Version:
A JavaScript plugin for entering and validating international telephone numbers
27 lines (19 loc) • 573 B
JavaScript
;
describe("setCountry: init plugin and calling public method setCountry()", function() {
var countryCode = "gb";
beforeEach(function() {
intlSetup();
input = $("<input>").wrap("div");
iti = window.intlTelInput(input[0]);
iti.setCountry(countryCode);
});
afterEach(function() {
intlTeardown();
});
it("updates the selected flag", function() {
expect(getSelectedFlagElement()).toHaveClass(`iti__${countryCode}`);
});
it("does not insert the dial code", function() {
expect(getInputVal()).toEqual("");
});
});