Exemplo n.º 1
0
		it('should have a disabled "url" field', function () {
			var field = this.form.querySelectorAll('input[name=url]')[0];
			assert.isDefined(field);
			assert.strictEqual(field.getAttribute('type'), 'url');
			assert.strictEqual(field.getAttribute('value'), 'nature.com');
			assert.isDefined(field.getAttribute('disabled'));
		});
Exemplo n.º 2
0
		it('should have a disabled "url" field', function() {
			var field = this.form.find('input[name=url]').eq(0);
			assert.isDefined(field);
			assert.strictEqual(field.attr('type'), 'url');
			assert.strictEqual(field.attr('value'), 'nature.com');
			assert.isDefined(field.attr('disabled'));
		});
Exemplo n.º 3
0
		inject(window, options, function(result) {
			assert.isDefined(result.messages);
			assert.deepEqual(result.messages, [
				{
					code: 'foo-code',
					context: '<element>foo inner</element>',
					message: 'foo message',
					selector: '',
					type: 'error',
					typeCode: 1
				},
				{
					code: 'bar-code',
					context: '<element>bar inner at more than 30 chara...</element>',
					message: 'bar message',
					selector: '',
					type: 'warning',
					typeCode: 2
				},
				{
					code: 'baz-code',
					context: '<element with=\"loads of attributes\" that=\"push the total outerHTML length\" to=\"more than we really want to send back to Node.js\" this=\"is getting kind of silly now, I really want to stop writing dummy text to push the length of this element out\">baz ...',
					message: 'baz message',
					selector: '',
					type: 'notice',
					typeCode: 3
				}
			]);
			done();
		});
Exemplo n.º 4
0
		inject(window, options, function(result) {
			assert.isDefined(result.messages);
			assert.deepEqual(result.messages, [
				{
					code: 'foo-code',
					context: '<element>outside hideElements</element>',
					message: 'foo message',
					selector: '',
					type: 'error',
					typeCode: 1
				}
			]);
			done();
		});
Exemplo n.º 5
0
		inject(window, options, function(result) {
			assert.isDefined(result.messages);
			assert.deepEqual(result.messages, [
				{
					code: 'foo-code',
					context: null,
					message: 'foo message',
					selector: '',
					type: 'unknown',
					typeCode: 4
				}
			]);
			done();
		});
Exemplo n.º 6
0
		inject(window, options, function(result) {
			assert.isDefined(result.messages);
			assert.deepEqual(result.messages, [
				{
					code: 'bar-code',
					context: '<element>bar inner at more than 30 chara...</element>',
					message: 'bar message',
					selector: '',
					type: 'warning',
					typeCode: 2
				}
			]);
			done();
		});
Exemplo n.º 7
0
		it('should display links to all results', function () {
			assert.isDefined(this.last.dom.querySelectorAll('[href="/abc000000000000000000001/def000000000000000000001"]')[0]);
			assert.isDefined(this.last.dom.querySelectorAll('[href="/abc000000000000000000001/def000000000000000000003"]')[0]);
		});
Exemplo n.º 8
0
		it('should have "ignore" fields', function() {
			var fields = this.form.find('input[name="ignore[]"]');
			assert.isDefined(fields);
			assert.notStrictEqual(fields.length, 0);
		});
Exemplo n.º 9
0
		it('should have a "password" field', function() {
			var field = this.form.find('input[name=password]').eq(0);
			assert.isDefined(field);
			assert.strictEqual(field.attr('type'), 'text');
			assert.strictEqual(field.attr('value'), 'access');
		});
Exemplo n.º 10
0
		it('should have a "name" field', function () {
			var field = this.form.querySelectorAll('input[name=name]')[0];
			assert.isDefined(field);
			assert.strictEqual(field.getAttribute('type'), 'text');
			assert.strictEqual(field.getAttribute('value'), '');
		});
Exemplo n.º 11
0
		it('should have a disabled "standard" field', function () {
			var field = this.form.querySelectorAll('select[name=standard]')[0];
			assert.isDefined(field);
			assert.isDefined(field.getAttribute('disabled'));
		});
Exemplo n.º 12
0
		it('should display a message indicating that there are no results', function () {
			var alert = this.last.dom.querySelectorAll('[data-test=alert]')[0];
			assert.isDefined(alert);
			assert.match(alert.textContent, /there are no results to show/i);
		});
Exemplo n.º 13
0
	it('should display a success message', function() {
		var alert = this.last.dom('[data-test=alert]').eq(0);
		assert.isDefined(alert);
		assert.match(alert.text(), /been saved/i);
	});
Exemplo n.º 14
0
	it('should display a link back to the task', function() {
		assert.isDefined(this.last.dom.querySelectorAll('[href="/abc000000000000000000001"]')[0]);
	});
Exemplo n.º 15
0
		it('should have a "standard" field', function() {
			const field = this.form.find('select[name=standard]').eq(0);
			assert.isDefined(field);
			assert.strictEqual(field.find('option').length, 4);
		});
Exemplo n.º 16
0
		it('should have a "wait" field', function() {
			const field = this.form.find('input[name=wait]').eq(0);
			assert.isDefined(field);
			assert.strictEqual(field.attr('type'), 'text');
			assert.strictEqual(field.attr('value'), '');
		});
Exemplo n.º 17
0
	it('should have an "Add new URL" form', function() {
		const form = this.last.dom('[data-test=new-url-form]').eq(0);
		assert.isDefined(form);
		assert.strictEqual(form.attr('action'), '/new');
		assert.strictEqual(form.attr('method'), 'post');
	});
Exemplo n.º 18
0
		it('should display a success message', function() {
			const alert = this.last.dom('[data-test=alert]').eq(0);
			assert.isDefined(alert);
			assert.match(alert.textContent, /url has been added/i);
		});
Exemplo n.º 19
0
		it('should have a "standard" field', function () {
			var field = this.form.querySelectorAll('select[name=standard]')[0];
			assert.isDefined(field);
			assert.strictEqual(field.querySelectorAll('option').length, 4);
		});
Exemplo n.º 20
0
		it('should display warnings', function () {
			var elem = this.last.dom.querySelectorAll('[data-test=task-warnings]')[0];
			assert.isDefined(elem);
			assert.match(elem.textContent, /warnings \( 2 \)/i);
		});
Exemplo n.º 21
0
		it('should display notices', function () {
			var elem = this.last.dom.querySelectorAll('[data-test=task-notices]')[0];
			assert.isDefined(elem);
			assert.match(elem.textContent, /notices \( 3 \)/i);
		});
Exemplo n.º 22
0
	it('should have an "Edit URL" form', function() {
		var form = this.last.dom('[data-test=edit-url-form]').eq(0);
		assert.isDefined(form);
		assert.strictEqual(form.attr('action'), '/abc000000000000000000001/edit');
		assert.strictEqual(form.attr('method'), 'post');
	});
Exemplo n.º 23
0
	it('should display a success message', function () {
		var alert = this.last.dom.querySelectorAll('[data-test=alert]')[0];
		assert.isDefined(alert);
		assert.match(alert.textContent, /new results are being generated/i);
	});
Exemplo n.º 24
0
		inject(window, options, function(result) {
			assert.isDefined(result.error);
			assert.strictEqual(result.error, 'HTML CodeSniffer: Oopsie');
			done();
		});
Exemplo n.º 25
0
		it('should display a success message', function () {
			var alert = this.last.dom.querySelectorAll('[data-test=alert]')[0];
			assert.isDefined(alert);
			assert.match(alert.textContent, /url has been added/i);
		});
Exemplo n.º 26
0
		it('should have a "username" field', function() {
			var field = this.form.find('input[name=username]').eq(0);
			assert.isDefined(field);
			assert.strictEqual(field.attr('type'), 'text');
			assert.strictEqual(field.attr('value'), 'user');
		});
Exemplo n.º 27
0
		inject(window, options, function(result) {
			assert.isDefined(result.messages);
			assert.lengthEquals(result.messages, 1);
			assert.strictEqual(result.messages[0].selector, 'foo > bar');
			done();
		});
Exemplo n.º 28
0
	it('should have an "Add new URL" form', function () {
		var form = this.last.dom.querySelectorAll('[data-test=new-url-form]')[0];
		assert.isDefined(form);
		assert.strictEqual(form.getAttribute('action'), '/new');
		assert.strictEqual(form.getAttribute('method'), 'post');
	});
Exemplo n.º 29
0
		it('should have a disabled "standard" field', function() {
			var field = this.form.find('select[name=standard]').eq(0);
			assert.isDefined(field);
			assert.isDefined(field.attr('disabled'));
		});
				it('should have a `hostname` property set to the gateway\'s corresponding hostname', () => {
					assert.isDefined(instance.hostname);
					assert.strictEqual(instance.hostname, 'http://test.konstructor.svc.ft.com');
				});