-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
auto-prefix mailto: to email addresses when linkValidation is enabled…
… on the anchor extension fixes #1312
- Loading branch information
1 parent
df53c61
commit 04798f3
Showing
2 changed files
with
23 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -240,6 +240,24 @@ describe('Anchor Button TestCase', function () { | |
expect(link.href).toBe('tel:347-999-9999'); | ||
}); | ||
|
||
it('should add mailto: if need be and linkValidation option is set to true', function () { | ||
var editor = this.newMediumEditor('.editor', { | ||
anchor: { | ||
linkValidation: true | ||
} | ||
}), | ||
link, | ||
anchorExtension = editor.getExtensionByName('anchor'); | ||
|
||
selectElementContentsAndFire(editor.elements[0]); | ||
anchorExtension.showForm('[email protected]'); | ||
fireEvent(anchorExtension.getForm().querySelector('a.medium-editor-toolbar-save'), 'click'); | ||
|
||
link = editor.elements[0].querySelector('a'); | ||
expect(link).not.toBeNull(); | ||
expect(link.href).toBe('mailto:[email protected]'); | ||
}); | ||
|
||
it('should not change protocol when a valid one is included', function () { | ||
var editor = this.newMediumEditor('.editor', { | ||
anchor: { | ||
|
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