multi-check unit test repairs

This commit is contained in:
Carlos 2017-10-20 10:42:55 +02:00
parent 3badf2a48a
commit 8bb2536f90
1 changed files with 14 additions and 14 deletions

View File

@ -34,7 +34,7 @@ describe('Component vnMultiCheck', () => {
});
describe('switchChecks()', () => {
/* it(`should set checked property inside each existing elemenet when begings with no-`, () => {
it(`should set checked property inside each existing elemenet when id begings with no-`, () => {
controller.type = {id: 'no-name'};
controller.models = [
{name: 'name'},
@ -46,11 +46,11 @@ describe('Component vnMultiCheck', () => {
controller._checkAll = 1;
controller.switchChecks();
expect(controller._models[0].checked).toBeFalsy();
expect(controller._models[0].checked).toBeTruthy();
expect(controller._models[1].checked).toBeTruthy();
});
it(`should set checked property inside each existing elemenet when begings with equal-`, () => {
it(`should set checked property inside each existing elemenet when id begings with equal-`, () => {
controller.type = {id: 'equal-name', name: 'name'};
controller.models = [
{name: null},
@ -62,7 +62,7 @@ describe('Component vnMultiCheck', () => {
controller._checkAll = 1;
controller.switchChecks();
expect(controller._models[0].checked).toBeFalsy();
expect(controller._models[0].checked).toBeTruthy();
expect(controller._models[1].checked).toBeTruthy();
});
@ -78,10 +78,10 @@ describe('Component vnMultiCheck', () => {
controller._checkAll = 1;
controller.switchChecks();
expect(controller._models[0].checked).toBeFalsy();
expect(controller._models[0].checked).toBeTruthy();
expect(controller._models[1].checked).toBeTruthy();
});
*/
describe('when id is any', () => {
it('should set element checked property based on controller._checkAll', () => {
controller.type = {id: 'any'};
@ -140,24 +140,24 @@ describe('Component vnMultiCheck', () => {
});
});
/* describe('$doCheck()', () => {
describe('type setter', () => {
it('should set controller.type to empty object and checkAll based on controller.type.id', () => {
controller.type = {id: 'all'};
let value = {id: 'all'};
controller._checkAll = 0;
controller.$doCheck();
controller.type = value;
expect(controller.type).toEqual({});
expect(controller._checkAll).toEqual(1);
controller.type = {id: 'any'};
controller.$doCheck();
value = {id: 'any'};
controller.type = value;
expect(controller.type).toEqual({});
expect(controller._checkAll).toEqual(0);
controller.type = {id: 'any other id name'};
controller.$doCheck();
value = {id: 'any other id name'};
controller.type = value;
expect(controller.type).toEqual({});
expect(controller._checkAll).toEqual(2);
});
}); */
});
});