Sha256: 435304bc6cf9cfde47ccd694ed1472370f3c368c43fa14f510fce675bb068d81

Contents?: true

Size: 1.12 KB

Versions: 40

Compression:

Stored size: 1.12 KB

Contents

test('atomic/core/UrlTypeTest', [
	'tinymce/inlite/core/UrlType'
], function (UrlType) {
	var testIsDomainLike = function () {
		var mostUsedTopLevelDomains = [
			'com', 'org', 'edu', 'gov', 'uk', 'net', 'ca', 'de', 'jp',
			'fr', 'au', 'us', 'ru', 'ch', 'it', 'nl', 'se', 'no', 'es', 'mil'
		];

		assert.eq(UrlType.isDomainLike('www.site.com'), true);
		assert.eq(UrlType.isDomainLike('www.site.xyz'), true);
		assert.eq(UrlType.isDomainLike('   www.site.xyz'), true);
		assert.eq(UrlType.isDomainLike('site.xyz'), false);

		mostUsedTopLevelDomains.forEach(function (tld) {
			assert.eq(UrlType.isDomainLike('site.' + tld), true);
			assert.eq(UrlType.isDomainLike('  site.' + tld), true);
			assert.eq(UrlType.isDomainLike('site.' + tld + '  '), true);
		});

		assert.eq(UrlType.isDomainLike('/a/b'), false);
	};

	var testIsAbsoluteUrl = function () {
		assert.eq(UrlType.isAbsolute('http://www.site.com'), true);
		assert.eq(UrlType.isAbsolute('https://www.site.com'), true);
		assert.eq(UrlType.isAbsolute('www.site.com'), false);
		assert.eq(UrlType.isAbsolute('file.gif'), false);
	};

	testIsDomainLike();
	testIsAbsoluteUrl();
});

Version data entries

40 entries across 40 versions & 2 rubygems

Version Path
wbase-0.3.0 lib/vendor/admin/tinymce/themes/inlite/src/test/js/atomic/core/UrlTypeTest.js
wbase-0.2.9 lib/vendor/admin/tinymce/themes/inlite/src/test/js/atomic/core/UrlTypeTest.js
wbase-0.2.8 lib/vendor/admin/tinymce/themes/inlite/src/test/js/atomic/core/UrlTypeTest.js
wbase-0.2.7 lib/vendor/admin/tinymce/themes/inlite/src/test/js/atomic/core/UrlTypeTest.js
wbase-0.2.6 lib/vendor/admin/tinymce/themes/inlite/src/test/js/atomic/core/UrlTypeTest.js
wbase-0.2.5 lib/vendor/admin/tinymce/themes/inlite/src/test/js/atomic/core/UrlTypeTest.js
wbase-0.2.4 lib/vendor/admin/tinymce/themes/inlite/src/test/js/atomic/core/UrlTypeTest.js
wbase-0.2.3 lib/vendor/admin/tinymce/themes/inlite/src/test/js/atomic/core/UrlTypeTest.js
wbase-0.2.2 lib/vendor/admin/tinymce/themes/inlite/src/test/js/atomic/core/UrlTypeTest.js
wbase-0.2.1 lib/vendor/admin/tinymce/themes/inlite/src/test/js/atomic/core/UrlTypeTest.js
wbase-0.2.0 lib/vendor/admin/tinymce/themes/inlite/src/test/js/atomic/core/UrlTypeTest.js
wbase-0.1.7 app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/test/js/atomic/core/UrlTypeTest.js
wbase-0.1.6 app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/test/js/atomic/core/UrlTypeTest.js
wbase-0.1.5 app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/test/js/atomic/core/UrlTypeTest.js
wbase-0.1.4 app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/test/js/atomic/core/UrlTypeTest.js
wbase-0.1.3 app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/test/js/atomic/core/UrlTypeTest.js
wbase-0.1.2 app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/test/js/atomic/core/UrlTypeTest.js
wbase-0.1.0 app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/test/js/atomic/core/UrlTypeTest.js
wbase-0.0.15 app/assets/javascripts/wbase/admin/tinymce/themes/inlite/src/test/js/atomic/core/UrlTypeTest.js
tinymce-rails-4.4.1 vendor/assets/javascripts/tinymce/themes/inlite/src/test/js/atomic/core/UrlTypeTest.js