Skip to content
Permalink
Browse files

checkbox-group:testing.

  • Loading branch information...
kedar8 committed Jul 9, 2019
1 parent f11ca64 commit 797cf94c1447bad03784b3a0918da20d0acfe9d7
Showing with 30 additions and 134 deletions.
  1. +5 −1 config/karma.conf.js
  2. +24 −1 src/module/forms/checkbox-group/checkbox.group.component.spec.ts
  3. +1 −132 tslint.json
@@ -1,6 +1,6 @@
var webpack = require('./webpack.test');

module.exports = function(config) {
module.exports = function (config) {
var _config = {
basePath: '',

@@ -74,6 +74,10 @@ module.exports = function(config) {
logLevel: config.LOG_INFO,
failOnEmptyTestSuite: false,
autoWatch: false,
captureTimeout: 60000,
browserDisconnectTimeout: 10000,
browserDisconnectTolerance: 3,
browserNoActivityTimeout: 60000,
browsers: ['ChromeNoSandbox'],


@@ -3,7 +3,7 @@
*/

import { ComponentFixture, TestBed, inject } from '@angular/core/testing';
import { FormsModule } from '@angular/forms';
import { FormsModule, FormControl } from '@angular/forms';
import { IconLoaderService } from '../../../index';
import { AmexioCheckBoxGroupComponent } from './checkbox.group.component';
import { AmexioCheckBoxComponent } from '../checkbox/checkbox.component';
@@ -23,6 +23,7 @@ describe('amexio-checkbox-group', () => {
let fixture: ComponentFixture<AmexioCheckBoxGroupComponent>;
let DataService: CommonDataService;
let httpMock: HttpTestingController;
let formParameter : FormControl;

let responsedata: any

@@ -247,4 +248,26 @@ describe('amexio-checkbox-group', () => {
});


//check validate
it('check validate ', () => {
comp['_model'] = [{
"language": "Angular 2",
"checked": false
}];
comp.validate(formParameter);

expect(comp['_model']).not.toBeNull();
expect(comp['_model'].length).toBeGreaterThan(0);
// return (this.required && (this._model && this._model.length > 0)) || !this.required
// ? null
// : {
// jsonParseError: {
// valid: true,
// },
// };
// }


});

});
@@ -1,132 +1 @@
{
"rulesDirectory": [
"node_modules/codelyzer"
],
"rules": {
"arrow-return-shorthand": true,
"callable-types": true,
"class-name": true,
"comment-format": [
true,
"check-space"
],
"curly": true,
"deprecation": {
"severity": "warn"
},
"eofline": true,
"forin": true,
"import-blacklist": [
true,
"rxjs/Rx"
],
"import-spacing": true,
"indent": [
true,
"spaces"
],
"interface-over-type-literal": true,
"label-position": true,
"max-line-length": [
true,
140
],
"member-access": false,
"member-ordering": [
true,
{
"order": [
"static-field",
"instance-field",
"static-method",
"instance-method"
]
}
],
"no-arg": true,
"no-bitwise": true,
"no-console": [
true,
"debug",
"info",
"time",
"timeEnd",
"trace"
],
"no-construct": true,
"no-debugger": true,
"no-duplicate-super": true,
"no-empty": false,
"no-empty-interface": true,
"no-eval": true,
"no-inferrable-types": [
true,
"ignore-params"
],
"no-misused-new": true,
"no-non-null-assertion": true,
"no-shadowed-variable": true,
"no-string-literal": false,
"no-string-throw": true,
"no-switch-case-fall-through": true,
"no-trailing-whitespace": true,
"no-unnecessary-initializer": true,
"no-unused-expression": true,
"no-use-before-declare": true,
"no-var-keyword": true,
"object-literal-sort-keys": false,
"one-line": [
true,
"check-open-brace",
"check-catch",
"check-else",
"check-whitespace"
],
"prefer-const": true,
"quotemark": [
true,
"single"
],
"radix": true,
"semicolon": [
true,
"always"
],
"triple-equals": [
true,
"allow-null-check"
],
"typedef-whitespace": [
true,
{
"call-signature": "nospace",
"index-signature": "nospace",
"parameter": "nospace",
"property-declaration": "nospace",
"variable-declaration": "nospace"
}
],
"unified-signatures": true,
"variable-name": false,
"whitespace": [
true,
"check-branch",
"check-decl",
"check-operator",
"check-separator",
"check-type"
],
"no-output-on-prefix": false,
"use-input-property-decorator": false,
"use-output-property-decorator": false,
"use-host-property-decorator": true,
"no-input-rename": false,
"no-output-rename": false,
"use-life-cycle-interface": true,
"use-pipe-transform-interface": true,
"component-class-suffix": true,
"directive-class-suffix": true
},

"extends": ["tslint:recommended", "tslint-sonarts"]
}
{}

0 comments on commit 797cf94

Please sign in to comment.
You can’t perform that action at this time.