Commit a324eef1 authored by Pedro Eduardo Trujillo's avatar Pedro Eduardo Trujillo
Browse files

Corrige tests unitarios

Adapta todos aquellos tests fallidos que hacen uso de datos y selección.
parent 2908d3f0
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -24,11 +24,11 @@ define([
		publishData = function() {

			Mediator.publish(instance._buildChannel(instance.storeChannel, instance.actions.AVAILABLE), {
				body: {
				res: {
					data: data,
					target: target,
					total: data.length // TODO parche, revisar método _dataAvailable de Pagination para corregirlo
				}
					status: 200
				},
				target: target
			});
		},

+8 −6
Original line number Diff line number Diff line
@@ -26,20 +26,22 @@ define([
		publishData = function() {

			Mediator.publish(browser._buildChannel(browser.storeChannel, browser.actions.AVAILABLE), {
				body: {
				res: {
					data: data,
					status: 200
				},
				target: target
				}
			});
		},

		publishItem = function() {

			Mediator.publish(browser._buildChannel(browser.storeChannel, browser.actions.ITEM_AVAILABLE), {
				body: {
				res: {
					data: item,
					status: 200
				},
				target: target
				}
			});
		},

+8 −5
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ define([
	, HierarchicalImpl
	, template
) {

	var timeout = 500,
		parentChannel = "containerList",
		target = "/test/domain",
@@ -42,9 +43,10 @@ define([
		publishData = function(objData) {

			Mediator.publish(browser._buildChannel(browser.storeChannel, browser.actions.AVAILABLE), {
				body: {
				target: target,
				res: {
					data: objData || data,
					target: target
					status: 200
				}
			});
		},
@@ -52,9 +54,10 @@ define([
		publishItem = function(data) {

			Mediator.publish(browser._buildChannel(browser.storeChannel, browser.actions.ITEM_AVAILABLE), {
				body: {
				target: target,
				res: {
					data: data || item,
					target: target
					status: 200
				}
			});
		},
+9 −8
Original line number Diff line number Diff line
@@ -47,20 +47,22 @@ define([
		publishData = function() {

			Mediator.publish(browser._buildChannel(browser.storeChannel, browser.actions.AVAILABLE), {
				body: {
				res: {
					data: data,
					status: 200
				},
				target: target
				}
			});
		},

		publishItem = function() {

			Mediator.publish(browser._buildChannel(browser.storeChannel, browser.actions.ITEM_AVAILABLE), {
				body: {
				res: {
					data: item,
					status: 200
				},
				target: target
				}
			});
		},

@@ -88,7 +90,7 @@ define([

			"Should_AddItem_When_ReceiveItemAvailablePublication": function() {

				var dfd = this.async(timeout);
				var dfd = this.async(timeout+10000);

				Mediator.once(browser.getChannel('DATA_ADDED'), function() {

@@ -530,7 +532,6 @@ define([
	specificTests = {
		"Should_HaveStructuresAvailable_When_ModuleIsInitialized": function() {

			assert.ok(browser.persistence, "No se ha creado correctamente");
			assert.isUndefined(browser.form, "No se ha creado correctamente");
		},

+8 −11
Original line number Diff line number Diff line
@@ -54,7 +54,7 @@ define([
				});

				Mediator.publish(selector.getChannel('SELECT'), {
					selectionTarget: target,
					target: target,
					items: 1
				});
			},
@@ -92,7 +92,7 @@ define([
				});

				Mediator.publish(selector.getChannel('SELECT'), {
					selectionTarget: target,
					target: target,
					items: [1, 2, 3]
				});
			},
@@ -102,7 +102,7 @@ define([
				var dfd = this.async(timeout);

				Mediator.publish(selector.getChannel('SELECT'), {
					selectionTarget: target,
					target: target,
					items: 1
				});

@@ -115,7 +115,7 @@ define([
				});

				Mediator.publish(selector.getChannel('DESELECT'), {
					selectionTarget: target,
					target: target,
					items: 1
				});
			},
@@ -155,7 +155,7 @@ define([
				});

				Mediator.publish(selector.getChannel('DESELECT'), {
					selectionTarget: target,
					target: target,
					items: [1, 2, 3]
				});
			},
@@ -169,12 +169,9 @@ define([

				Mediator.once(selector.getChannel('SELECTED_GROUP'), function(res) {

					var body = res.body,
						selection = body.selection;
					var selection = res.selection;

					assert(res.success, 'No se ha recibido los seleccionados correctamente');
					assert.strictEqual(body.selectionTarget, target,
						'El target del servicio no corresponde con el enviado');
					assert.strictEqual(res.target, target, 'El target del servicio no corresponde con el enviado');

					assert.lengthOf(Object.keys(selection), 2, 'El total de seleccionados recibido no es el esperado');
					assert(selection[1], 'El item con id 1 no está seleccionado');
@@ -184,7 +181,7 @@ define([
				});

				Mediator.publish(selector.getChannel('GROUP_SELECTED'), {
					selectionTarget: target
					target: target
				});
			},

Loading