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

Parchea tests "unitarios" de módulo browser

No eran tan unitarios después de todo, porque dependían de MasterStore.
parent 61dc294f
Loading
Loading
Loading
Loading
+7 −10
Original line number Diff line number Diff line
@@ -4,7 +4,6 @@ define([
	, "put-selector/put"
	, "redmic/base/Mediator"
	, "redmic/modules/browser/bars/Pagination"
	, "redmic/modules/store/MasterStore"
	, "templates/DomainList"
], function(
	declare
@@ -12,26 +11,24 @@ define([
	, put
	, Mediator
	, Pagination
	, MasterStore
	, template
){
	var timeout = 100,
		parentChannel = "container",
		target = "/api/domain",
		row, config, data, item,
		row, config, data, item, instance,

		registerSuite = intern.getInterface('object').registerSuite,
		assert = intern.getPlugin('chai').assert,

		masterStore = new MasterStore({
			parentChannel: "app"
		}),

		publishData = function() {

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

+10 −12
Original line number Diff line number Diff line
@@ -5,7 +5,6 @@ define([
	, "redmic/base/Mediator"
	, "redmic/modules/browser/bars/Total"
	, "redmic/modules/browser/ListImpl"
	, "redmic/modules/store/MasterStore"
	, "templates/DomainList"
], function(
	declare
@@ -14,7 +13,6 @@ define([
	, Mediator
	, Total
	, ListImpl
	, MasterStore
	, template
){
	var timeout = 100,
@@ -25,23 +23,23 @@ define([
		registerSuite = intern.getInterface('object').registerSuite,
		assert = intern.getPlugin('chai').assert,

		masterStore = new MasterStore({
			parentChannel: "app"
		}),

		publishData = function() {

			Mediator.publish(masterStore.getChannel("INJECT_DATA"), {
			Mediator.publish(browser._buildChannel(browser.storeChannel, browser.actions.AVAILABLE), {
				body: {
					data: data,
					target: target
				}
			});
		},

		publishItem = function() {

			Mediator.publish(masterStore.getChannel("INJECT_ITEM"), {
			Mediator.publish(browser._buildChannel(browser.storeChannel, browser.actions.ITEM_AVAILABLE), {
				body: {
					data: item,
					target: target
				}
			});
		},

+11 −13
Original line number Diff line number Diff line
@@ -13,7 +13,6 @@ define([
	, "redmic/modules/browser/_MultiTemplate"
	, "redmic/modules/browser/_NoDataTemplate"
	, "redmic/modules/browser/HierarchicalImpl"
	, "redmic/modules/store/MasterStore"
	, "templates/DomainList"
], function(
	declare
@@ -30,7 +29,6 @@ define([
	, _MultiTemplate
	, _NoDataTemplate
	, HierarchicalImpl
	, MasterStore
	, template
){
	var timeout = 500,
@@ -41,23 +39,23 @@ define([
		registerSuite = intern.getInterface('object').registerSuite,
		assert = intern.getPlugin('chai').assert,

		masterStore = new MasterStore({
			parentChannel: "app"
		}),

		publishData = function(objData) {

			Mediator.publish(masterStore.getChannel("INJECT_DATA"), {
			Mediator.publish(browser._buildChannel(browser.storeChannel, browser.actions.AVAILABLE), {
				body: {
					data: objData || data,
					target: target
				}
			});
		},

		publishItem = function(data) {

			Mediator.publish(masterStore.getChannel("INJECT_ITEM"), {
			Mediator.publish(browser._buildChannel(browser.storeChannel, browser.actions.ITEM_AVAILABLE), {
				body: {
					data: data || item,
					target: target
				}
			});
		},

@@ -936,7 +934,7 @@ define([

			var dfd = this.async(timeout);

			Mediator.once(masterStore.getChannel('REQUEST'), function() {
			Mediator.once(browser._buildChannel(browser.storeChannel, browser.actions.REQUEST), function() {
				dfd.resolve();
			});

+10 −12
Original line number Diff line number Diff line
@@ -13,7 +13,6 @@ define([
	, "redmic/modules/browser/_Select"
	, "redmic/modules/browser/_Table"
	, "redmic/modules/browser/ListImpl"
	, "redmic/modules/store/MasterStore"
	, "templates/DomainList"
], function(
	declare
@@ -30,7 +29,6 @@ define([
	, _Select
	, _Table
	, ListImpl
	, MasterStore
	, template
){
	var timeout = 300,
@@ -41,10 +39,6 @@ define([
		registerSuite = intern.getInterface('object').registerSuite,
		assert = intern.getPlugin('chai').assert,

		masterStore = new MasterStore({
			parentChannel: "app"
		}),

		getRow = function(idProperty) {

			return browser._getRow(idProperty);
@@ -52,17 +46,21 @@ define([

		publishData = function() {

			Mediator.publish(masterStore.getChannel("INJECT_DATA"), {
			Mediator.publish(browser._buildChannel(browser.storeChannel, browser.actions.AVAILABLE), {
				body: {
					data: data,
					target: target
				}
			});
		},

		publishItem = function() {

			Mediator.publish(masterStore.getChannel("INJECT_ITEM"), {
			Mediator.publish(browser._buildChannel(browser.storeChannel, browser.actions.ITEM_AVAILABLE), {
				body: {
					data: item,
					target: target
				}
			});
		},

+1 −1

File changed.

Contains only whitespace changes.