Skip to content

Commit

Permalink
checkbox-group:testing.
Browse files Browse the repository at this point in the history
  • Loading branch information
kedar8 committed Jul 9, 2019
1 parent f11ca64 commit 797cf94
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 134 deletions.
6 changes: 5 additions & 1 deletion config/karma.conf.js
@@ -1,6 +1,6 @@
var webpack = require('./webpack.test');

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

Expand Down Expand Up @@ -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'],


Expand Down
25 changes: 24 additions & 1 deletion src/module/forms/checkbox-group/checkbox.group.component.spec.ts
Expand Up @@ -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';
Expand All @@ -23,6 +23,7 @@ describe('amexio-checkbox-group', () => {
let fixture: ComponentFixture<AmexioCheckBoxGroupComponent>;
let DataService: CommonDataService;
let httpMock: HttpTestingController;
let formParameter : FormControl;

let responsedata: any

Expand Down Expand Up @@ -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,
// },
// };
// }


});

});
133 changes: 1 addition & 132 deletions tslint.json
@@ -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.