File: test/core/elements.js

Recommend this page to a friend!
  Classes of Sebastian Schlapkohl  >  jQuery Annex  >  test/core/elements.js  >  Download  
File: test/core/elements.js
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: jQuery Annex
General purpose functions missing in jQuery
Author: By
Last change:
Date: 1 year ago
Size: 627 bytes


Class file image Download
import test from 'ava';

$versions.forEach($ => {
	let jqueryVersionString = ' @ jQuery '+$().jquery;

	test('$.elem'+jqueryVersionString, (assert) => {
		let $el = $.elem('div', {id : 'content', style : 'display:none;'}, 'loading...');

		assert.is($el.attr('id'), 'content');

	test('$.textContent'+jqueryVersionString, (assert) => {
		let source = '<p onlick="destroyWorld();">red button <a>meow<span>woof</span></a></p>';

		assert.is($.textContent(source), 'red button meowwoof');
		assert.is($.textContent($(source)), 'red button meowwoof');
		assert.is($.textContent($(source), true), 'red button');