* fix: multi lines and spaces issues * fix: eslint operator-linebreak issue * fix: eslint quotes issue * fix: remaining quotes issues * fix: eslint object curly newline issue * fix: eslint object curly spacing issue * fix: eslint brace-style issues * fix: react jsx indent and props issues * fix: eslint trailing spaces issues * fix: eslint linbreak style issue * fix: eslint space unary operator issue * fix: eslint line around directives issue * fix: void and typeof space unary ops issue
55 lines
2.1 KiB
JavaScript
55 lines
2.1 KiB
JavaScript
define(['Markdown.Editor'], function(MarkdownEditor) {
|
|
'use strict';
|
|
|
|
describe('Markdown.Editor', function() {
|
|
var editor = new MarkdownEditor();
|
|
|
|
describe('util.isValidUrl', function() {
|
|
it('should return true for http://example.com', function() {
|
|
expect(
|
|
editor.util.isValidUrl('http://example.com')
|
|
).toBeTruthy();
|
|
});
|
|
it('should return true for https://example.com', function() {
|
|
expect(
|
|
editor.util.isValidUrl('https://example.com')
|
|
).toBeTruthy();
|
|
});
|
|
it('should return true for ftp://example.com', function() {
|
|
expect(
|
|
editor.util.isValidUrl('ftp://example.com')
|
|
).toBeTruthy();
|
|
});
|
|
it('should return false for http://', function() {
|
|
expect(editor.util.isValidUrl('http://')).toBeFalsy();
|
|
});
|
|
it('should return false for https://', function() {
|
|
expect(editor.util.isValidUrl('https://')).toBeFalsy();
|
|
});
|
|
it('should return false for ftp://', function() {
|
|
expect(editor.util.isValidUrl('ftp://')).toBeFalsy();
|
|
});
|
|
it('should return false for fake://example.com', function() {
|
|
expect(
|
|
editor.util.isValidUrl('fakeprotocol://example.com')
|
|
).toBeFalsy();
|
|
});
|
|
it('should return false for fake://', function() {
|
|
expect(
|
|
editor.util.isValidUrl('fakeprotocol://')
|
|
).toBeFalsy();
|
|
});
|
|
it('should return false for www.noprotocol.com', function() {
|
|
expect(
|
|
editor.util.isValidUrl('www.noprotocol.com')
|
|
).toBeFalsy();
|
|
});
|
|
it('should return false for an empty string', function() {
|
|
expect(
|
|
editor.util.isValidUrl('')
|
|
).toBeFalsy();
|
|
});
|
|
});
|
|
});
|
|
});
|