Skip to content

Commit

Permalink
Merge pull request #96 from KB-iGOT/issue-7379-fix
Browse files Browse the repository at this point in the history
Issue 7379 fix
  • Loading branch information
vishnubansaltarento authored Nov 25, 2024
2 parents 2e4b22e + 3ec0051 commit a622fe2
Show file tree
Hide file tree
Showing 20 changed files with 433 additions and 2,106 deletions.
44 changes: 32 additions & 12 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,14 @@
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"preserveSymlinks": true,
"assets": ["src/favicon.png", "src/dashboard-assets/"],
"assets": [
"src/favicon.png",
"src/dashboard-assets/"
],
"stylePreprocessorOptions": {
"includePaths": ["src/styles"]
"includePaths": [
"src/styles"
]
},
"styles": [
{
Expand Down Expand Up @@ -215,16 +220,26 @@
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"assets": ["src/favicon.png"],
"styles": ["src/styles.scss"],
"assets": [
"src/favicon.png"
],
"styles": [
"src/styles.scss"
],
"scripts": []
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": ["tsconfig.app.json", "tsconfig.spec.json", "e2e/tsconfig.json"],
"exclude": ["**/node_modules/**", "**/**/*.spec.ts"]
"tsConfig": [
"tsconfig.app.json",
"tsconfig.spec.json",
"e2e/tsconfig.json"
],
"exclude": [
"**/node_modules/**"
]
}
},
"e2e": {
Expand Down Expand Up @@ -252,13 +267,13 @@
"options": {
"tsConfig": "project/ws/app/tsconfig.lib.json",
"project": "project/ws/app/ng-package.json"
},
"configurations": {
}
, "configurations": {
"production": {
"tsConfig": "project/ws/app/tsconfig.lib.prod.json"
}
}
},
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
Expand All @@ -270,8 +285,13 @@
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": ["project/ws/app/tsconfig.lib.json", "project/ws/app/tsconfig.spec.json"],
"exclude": ["**/node_modules/**"]
"tsConfig": [
"project/ws/app/tsconfig.lib.json",
"project/ws/app/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
Expand All @@ -286,4 +306,4 @@
"cli": {
"analytics": "9b3b22e4-cf51-4b7e-8fc7-460ef11cf24f"
}
}
}
12 changes: 4 additions & 8 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,8 @@ module.exports = {
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
transformIgnorePatterns: ['/node_modules/'],
// moduleNameMapper: {
// '^src/(.*)$': '/home/sujithsojan/Desktop/igot-jest/sunbird-cb-adminportal/src/$1',
// },
// setupFiles: ['/home/sujithsojan/Desktop/igot-jest/sunbird-cb-adminportal/src/jest.setup.ts'],
coverageDirectory: './coverage',
coverageReporters: ["clover", "json", "lcov", "text", "text-summary"],
collectCoverage: true,
testResultsProcessor: "jest-sonar-reporter",
moduleNameMapper: {
'^src/(.*)$': '/home/sujithsojan/Desktop/igot-jest/sunbird-cb-adminportal/src/$1',
},
setupFiles: ['/home/sujithsojan/Desktop/igot-jest/sunbird-cb-adminportal/src/jest.setup.ts'],
}
5 changes: 1 addition & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
"e2e": "ng e2e",
"i18n": "node --max_old_space_size=8000 ./node_modules/@angular/cli/bin/ng x--output-path locale",
"tailwind": "./node_modules/.bin/tailwind build ./src/tailwind-build.scss -o ./src/styles.scss",
"prestart": "npm run tailwind",
"sonar": "sonar-scanner"
"prestart": "npm run tailwind"
},
"private": true,
"dependencies": {
Expand Down Expand Up @@ -124,15 +123,13 @@
"gzipper": "^2.8.1",
"jasmine-core": "~3.6.0",
"jasmine-spec-reporter": "~5.0.0",
"jest-sonar-reporter": "^2.0.0",
"karma": "~6.4.4",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~3.0.2",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "^1.5.0",
"ng-packagr": "^12.2.7",
"protractor": "~7.0.0",
"sonarqube-scanner": "^4.2.5",
"ts-node": "~8.3.0",
"tslint": "~6.1.0",
"tslint-angular": "^3.0.2",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@

import { MatDialogRef } from '@angular/material/dialog'
import { FormBuilder } from '@angular/forms'
import { DialogTextProfanityComponent, IDialogData } from './discussion-post-popup.component'
import { DialogTextProfanityComponent } from './discussion-post-popup.component'
import { IDialogData } from './discussion-post.component'

describe('DialogTextProfanityComponent', () => {
let component: DialogTextProfanityComponent

const fb: Partial<FormBuilder> = {
group: jest.fn(),
}
const fb: Partial<FormBuilder> = {}
const dialogRef: Partial<MatDialogRef<DialogTextProfanityComponent>> = {}
const data: Partial<IDialogData> = {
profaneCategories: [],
}
const data: Partial<IDialogData> = {}

beforeAll(() => {
component = new DialogTextProfanityComponent(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

import { HttpClient } from '@angular/common/http'
import { ApprovedRequestsResolve } from './approvedrequests-resolver.service'


describe('ApprovedRequestsResolve', () => {
let component: ApprovedRequestsResolve

const http: Partial<HttpClient> = {}

beforeAll(() => {
component = new ApprovedRequestsResolve(
http as HttpClient
)
})

beforeEach(() => {
jest.clearAllMocks()
jest.resetAllMocks()
})

it('should create a instance of component', () => {
expect(component).toBeTruthy()
})
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

import { ConfigurationsService } from '@sunbird-cb/utils'
import { ConfigResolveService } from './config-resolver.service'

describe('ConfigResolveService', () => {
let component: ConfigResolveService

const confService: Partial<ConfigurationsService> = {}

beforeAll(() => {
component = new ConfigResolveService(
confService as ConfigurationsService
)
})

beforeEach(() => {
jest.clearAllMocks()
jest.resetAllMocks()
})

it('should create a instance of component', () => {
expect(component).toBeTruthy()
})
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { InitResolver } from "./init-resolve.service"


describe('InitResolver', () => {
let component: InitResolver



beforeAll(() => {
component = new InitResolver(

)
})

beforeEach(() => {
jest.clearAllMocks()
jest.resetAllMocks()
})

it('should create a instance of component', () => {
expect(component).toBeTruthy()
})
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

import { HttpClient } from '@angular/common/http'
import { ApprovedlistResolve } from './positionlist-resolver.service'

describe('ApprovedlistResolve', () => {
let component: ApprovedlistResolve

const http: Partial<HttpClient> = {}

beforeAll(() => {
component = new ApprovedlistResolve(
http as HttpClient
)
})

beforeEach(() => {
jest.clearAllMocks()
jest.resetAllMocks()
})

it('should create a instance of component', () => {
expect(component).toBeTruthy()
})
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@


import { HttpClient } from '@angular/common/http'
import { RejectedRequestsResolve } from './rejectedrequests-reoslver.service'

describe('RejectedRequestsResolve', () => {
let component: RejectedRequestsResolve

const http: Partial<HttpClient> = {}

beforeAll(() => {
component = new RejectedRequestsResolve(
http as HttpClient
)
})

beforeEach(() => {
jest.clearAllMocks()
jest.resetAllMocks()
})

it('should create a instance of component', () => {
expect(component).toBeTruthy()
})
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@


import { HttpClient } from '@angular/common/http'
import { RequestsResolve } from './requests-resolver.service'


describe('RequestsResolve', () => {
let component: RequestsResolve

const http: Partial<HttpClient> = {}

beforeAll(() => {
component = new RequestsResolve(
http as HttpClient
)
})

beforeEach(() => {
jest.clearAllMocks()
jest.resetAllMocks()
})

it('should create a instance of component', () => {
expect(component).toBeTruthy()
})
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { RolesService } from '../services/roles.service'
import { RolesResolver } from './roles-resolver.service'

describe('RolesResolver', () => {
let component: RolesResolver

const rolesService: Partial<RolesService> = {}

beforeAll(() => {
component = new RolesResolver(
rolesService as RolesService
)
})

beforeEach(() => {
jest.clearAllMocks()
jest.resetAllMocks()
})

it('should create a instance of component', () => {
expect(component).toBeTruthy()
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<mat-button-toggle-group class="category-card" #group="matButtonToggleGroup"
(change)="onValChange(group.value)" *ngFor="let image of imageList;let i =index"
[value]="toggle">
<mat-button-toggle [(value)]="image[i]">
<mat-button-toggle [(value)]="imageList[i]">
<img mat-card-image [src]="image.artifactUrl | publicGcpUrl" alt="code.image"
class="custom-img" (error)="changeToDefaultImg">
<mat-icon mat-card-avatar *ngIf="isChecked && thumbanilSelectval == image.identifier"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

import { MatDialog } from '@angular/material/dialog'
import { ConfigurationsService } from '@sunbird-cb/utils'
import { MatSnackBar } from '@angular/material/snack-bar'
import { DatePipe } from '@angular/common'
import { GeneralReportsService } from './general-reports.service'
import { GeneralReportsComponent } from './general-reports.component'

describe('GeneralReportsComponent', () => {
let component: GeneralReportsComponent

const dialog: Partial<MatDialog> = {}
const configSvc: Partial<ConfigurationsService> = {}
const generalReportsService: Partial<GeneralReportsService> = {}
const datePipe: Partial<DatePipe> = {}
const snackBar: Partial<MatSnackBar> = {}

beforeAll(() => {
component = new GeneralReportsComponent(
dialog as MatDialog,
configSvc as ConfigurationsService,
generalReportsService as GeneralReportsService,
datePipe as DatePipe,
snackBar as MatSnackBar
)
})

beforeEach(() => {
jest.clearAllMocks()
jest.resetAllMocks()
})

it('should create a instance of component', () => {
expect(component).toBeTruthy()
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,5 @@ describe('HomeComponent', () => {
it('should create a instance of component', () => {
expect(component).toBeTruthy()
})

})
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export class HelpCenterGuideComponent implements OnInit {
if (document.querySelector('.flex')) {
setTimeout(() => {
window.dispatchEvent(new Event('resize'))
}, 100)
}, 100)
}
}

Expand Down
Loading

0 comments on commit a622fe2

Please sign in to comment.