-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add setPlaceholderNumberType public method
- Loading branch information
Showing
6 changed files
with
48 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
"use strict"; | ||
|
||
describe("setPlaceholderNumberType: init vanilla plugin and call setPlaceholderNumberType with 'FIXED_LINE'", function() { | ||
|
||
beforeEach(function() { | ||
intlSetup(true); | ||
input = $("<input>"); | ||
input.intlTelInput({ | ||
initialCountry: "gb" | ||
}); | ||
}); | ||
|
||
afterEach(function() { | ||
input.intlTelInput("destroy'"); | ||
input = null; | ||
}); | ||
|
||
it("sets the placeholder to fixed line", function() { | ||
input.intlTelInput("setPlaceholderNumberType", "FIXED_LINE"); | ||
expect(input.attr("placeholder")).toEqual("0121 234 5678"); | ||
}); | ||
|
||
it("sets the placeholder to mobile", function() { | ||
input.intlTelInput("setPlaceholderNumberType", "MOBILE"); | ||
expect(input.attr("placeholder")).toEqual("07400 123456"); | ||
}); | ||
|
||
}); |