diff --git a/package.json b/package.json index c2080b0..c01e321 100644 --- a/package.json +++ b/package.json @@ -33,14 +33,14 @@ "@angular/router": "~15.2.10", "@auth0/angular-jwt": "^5.2.0", "@fullcalendar/core": "^6.1.14", - "@types/jquery": "^3.5.29", + "@types/jquery": "^3.5.31", "@types/quill": "2.0.14", "@uswds/uswds": "^3.9.0", "ag-grid": "^18.1.2", "ag-grid-angular": "^29.3.5", "angular2-font-awesome": "^1.3.0", "angular2-tooltip": "^3.1.0", - "chart.js": "^4.4.4", + "chart.js": "^4.4.5", "chart.js-plugin-labels-dv": "^5.0.1-beta", "chart.piecelabel.js": "^0.15.0", "chartjs-adapter-date-fns": "^3.0.0", @@ -63,11 +63,11 @@ "primeng": "^15.4.1", "rxjs": "^7.8.1", "rxjs-compat": "^6.6.7", - "tslib": "^2.7.0", + "tslib": "^2.8.0", "underscore": "^1.13.7", "url-search-params-polyfill": "^8.2.5", "web-animations-js": "^2.3.2", - "zone.js": "~0.14.8" + "zone.js": "~0.15.0" }, "devDependencies": { "@angular-devkit/build-angular": "^15.2.8", diff --git a/src/app/help/faq/faq.component.spec.ts b/src/app/help/faq/faq.component.spec.ts index e2478d4..60f08f4 100644 --- a/src/app/help/faq/faq.component.spec.ts +++ b/src/app/help/faq/faq.component.spec.ts @@ -47,12 +47,10 @@ describe('FaqComponent', () => { const mockElement = document.createElement('div'); mockElement.id = 'test'; spyOn(document, 'getElementById').and.returnValue(mockElement); - spyOn($.fn, 'animate'); + spyOn(mockElement, 'scrollIntoView'); component.scroll('test'); expect(document.getElementById).toHaveBeenCalledWith('test'); - expect($.fn.animate).toHaveBeenCalledWith({ - scrollTop: $(mockElement).offset().top - 80 - }); + expect(mockElement.scrollIntoView).toHaveBeenCalledWith({ behavior: 'smooth', block: 'start' }); }); it('should search for text', () => { diff --git a/src/app/solicitation/summary/results-detail/art-modal/art-category/art-category.component.spec.ts b/src/app/solicitation/summary/results-detail/art-modal/art-category/art-category.component.spec.ts index abb6889..61917a0 100644 --- a/src/app/solicitation/summary/results-detail/art-modal/art-category/art-category.component.spec.ts +++ b/src/app/solicitation/summary/results-detail/art-modal/art-category/art-category.component.spec.ts @@ -1,6 +1,9 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; - import { ArtCategoryComponent } from './art-category.component'; +// Import the module that declares p-checkbox +import { CheckboxModule } from 'primeng/checkbox'; +import { CommonModule } from '@angular/common'; +import { FormsModule } from '@angular/forms'; // Import FormsModule describe('ArtCategoryComponent', () => { let component: ArtCategoryComponent; @@ -8,12 +11,22 @@ describe('ArtCategoryComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ ArtCategoryComponent ] + declarations: [ ArtCategoryComponent ], + imports: [ CheckboxModule, CommonModule, FormsModule ], // Add FormsModule to imports }) .compileComponents(); fixture = TestBed.createComponent(ArtCategoryComponent); component = fixture.componentInstance; + component.category = { name: 'ICT Type', art_api: 'ict_type', type: 'array', + subcategories: [ + { name: 'ICT Products', art_api: 'it-prod'}, + { name: 'ICT Services', art_api: 'it-serv'}, + { name: 'None of the above', art_api: 'it-none'} + ]}; + + component.selectedCategories = []; + component.clearSelection = false; fixture.detectChanges(); }); diff --git a/src/app/solicitation/summary/results-detail/art-modal/art-modal.component.spec.ts b/src/app/solicitation/summary/results-detail/art-modal/art-modal.component.spec.ts index abc26c1..df74d22 100644 --- a/src/app/solicitation/summary/results-detail/art-modal/art-modal.component.spec.ts +++ b/src/app/solicitation/summary/results-detail/art-modal/art-modal.component.spec.ts @@ -1,6 +1,17 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { ArtIframeDialogComponent } from './art-modal.component'; +import { ArtService } from './art.service'; +import { HttpClientTestingModule } from '@angular/common/http/testing'; +import { SolicitationService } from '../../../solicitation.service'; +import { RouterTestingModule } from '@angular/router/testing'; +import { CommonModule } from '@angular/common'; +import { FormsModule } from '@angular/forms'; +import { ButtonModule } from 'primeng/button'; +import { DialogModule } from 'primeng/dialog'; +import { CheckboxModule } from 'primeng/checkbox'; + +import { ArtCategoryComponent } from './art-category/art-category.component'; describe('ArtIframeDialogComponent', () => { let component: ArtIframeDialogComponent; @@ -8,7 +19,11 @@ describe('ArtIframeDialogComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - declarations: [ ArtIframeDialogComponent ] + declarations: [ ArtIframeDialogComponent, ArtCategoryComponent ], + imports: [HttpClientTestingModule, RouterTestingModule.withRoutes([]), + CommonModule, FormsModule, ButtonModule, DialogModule, + CheckboxModule], + providers: [ArtService, SolicitationService] }) .compileComponents(); diff --git a/src/app/solicitation/summary/results-detail/art-modal/art-section/art-section.component.spec.ts b/src/app/solicitation/summary/results-detail/art-modal/art-section/art-section.component.spec.ts index 933a80d..5558eb4 100644 --- a/src/app/solicitation/summary/results-detail/art-modal/art-section/art-section.component.spec.ts +++ b/src/app/solicitation/summary/results-detail/art-modal/art-section/art-section.component.spec.ts @@ -14,6 +14,7 @@ describe('ArtSectionComponent', () => { fixture = TestBed.createComponent(ArtSectionComponent); component = fixture.componentInstance; + component.section = {text: 'test', value: 'test'} fixture.detectChanges(); }); diff --git a/src/app/solicitation/summary/results-detail/art-modal/art.service.spec.ts b/src/app/solicitation/summary/results-detail/art-modal/art.service.spec.ts index fb7f75b..1df7d34 100644 --- a/src/app/solicitation/summary/results-detail/art-modal/art.service.spec.ts +++ b/src/app/solicitation/summary/results-detail/art-modal/art.service.spec.ts @@ -1,12 +1,17 @@ import { TestBed } from '@angular/core/testing'; import { ArtService } from './art.service'; +import { HttpClientTestingModule } from '@angular/common/http/testing'; describe('ArtService', () => { let service: ArtService; beforeEach(() => { - TestBed.configureTestingModule({}); + TestBed.configureTestingModule({ + declarations: [], + imports: [HttpClientTestingModule], + providers: [ArtService] + }); service = TestBed.inject(ArtService); }); diff --git a/src/app/solicitation/summary/results-detail/results-detail.component.spec.ts b/src/app/solicitation/summary/results-detail/results-detail.component.spec.ts index 4aef774..431ff76 100644 --- a/src/app/solicitation/summary/results-detail/results-detail.component.spec.ts +++ b/src/app/solicitation/summary/results-detail/results-detail.component.spec.ts @@ -7,6 +7,16 @@ import { RouterTestingModule } from '@angular/router/testing'; import { SummaryComponent } from '../summary.component'; import { of } from 'rxjs'; import { Solicitation } from 'app/shared/solicitation'; +import { ArtIframeDialogComponent } from './art-modal/art-modal.component'; +import { ArtCategoryComponent } from './art-modal/art-category/art-category.component'; + +import { CommonModule } from '@angular/common'; +import { FormsModule } from '@angular/forms'; +import { ButtonModule } from 'primeng/button'; +import { DialogModule } from 'primeng/dialog'; +import { CheckboxModule } from 'primeng/checkbox'; + +import { ArtService } from './art-modal/art.service'; describe('ResultsDetailComponent', () => { let component: ResultsDetailComponent; @@ -16,9 +26,11 @@ describe('ResultsDetailComponent', () => { beforeEach(() => { TestBed.configureTestingModule({ - declarations: [SummaryComponent, ResultsDetailComponent ], - providers: [SolicitationService], - imports: [HttpClientTestingModule, RouterTestingModule.withRoutes([])] + declarations: [SummaryComponent, ResultsDetailComponent, + ArtIframeDialogComponent, ArtCategoryComponent], + providers: [SolicitationService, ArtService], + imports: [HttpClientTestingModule, RouterTestingModule.withRoutes([]), + CommonModule, FormsModule, ButtonModule, DialogModule, CheckboxModule] }) .compileComponents(); }); diff --git a/yarn.lock b/yarn.lock index bc4c96a..513bf50 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1913,10 +1913,10 @@ resolved "https://registry.npmjs.org/@types/jasmine/-/jasmine-4.3.2.tgz" integrity sha512-lKkWBcbxEZX/7nxPqEtv/OjPLaBa2j0o+hmv5Yn83b/+11C1kfBAkgvmrb13WDkmizUJ3B+jYrWh4M0YRtrzEQ== -"@types/jquery@^3.5.29": - version "3.5.30" - resolved "https://registry.npmjs.org/@types/jquery/-/jquery-3.5.30.tgz" - integrity sha512-nbWKkkyb919DOUxjmRVk8vwtDb0/k8FKncmUKFi+NY+QXqWltooxTrswvz4LspQwxvLdvzBN1TImr6cw3aQx2A== +"@types/jquery@^3.5.31": + version "3.5.32" + resolved "https://registry.yarnpkg.com/@types/jquery/-/jquery-3.5.32.tgz#3eb0da20611b92c7c49ebed6163b52a4fdc57def" + integrity sha512-b9Xbf4CkMqS02YH8zACqN1xzdxc3cO735Qe5AbSUFmyOiaWAbcpqh9Wna+Uk0vgACvoQHpWDg2rGdHkYPLmCiQ== dependencies: "@types/sizzle" "*" @@ -3228,10 +3228,10 @@ chart.js@^2.1.5: chartjs-color "^2.1.0" moment "^2.10.2" -chart.js@^4.4.4: - version "4.4.4" - resolved "https://registry.npmjs.org/chart.js/-/chart.js-4.4.4.tgz" - integrity sha512-emICKGBABnxhMjUjlYRR12PmOXhJ2eJjEHL2/dZlWjxRAZT1D8xplLFq5M0tMQK8ja+wBS/tuVEJB5C6r7VxJA== +chart.js@^4.4.5: + version "4.4.6" + resolved "https://registry.yarnpkg.com/chart.js/-/chart.js-4.4.6.tgz#da39b84ca752298270d4c0519675c7659936abec" + integrity sha512-8Y406zevUPbbIBA/HRk33khEmQPk5+cxeflWE/2rx1NJsjVWMPw/9mSP9rxHP5eqi6LNoPBVMfZHxbwLSgldYA== dependencies: "@kurkle/color" "^0.3.0" @@ -9901,7 +9901,7 @@ string-width@^1.0.1, string-width@^1.0.2: "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" - resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== dependencies: emoji-regex "^8.0.0" @@ -9955,7 +9955,7 @@ strip-ansi@^4.0.0: strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" - resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== dependencies: ansi-regex "^5.0.1" @@ -10334,10 +10334,15 @@ tslib@^1.10.0, tslib@^1.13.0, tslib@^1.8.1, tslib@^1.9.0: resolved "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== -tslib@^2.0.0, tslib@^2.0.1, tslib@^2.1.0, tslib@^2.3.0, tslib@^2.4.0, tslib@^2.5.3, tslib@^2.7.0: - version "2.7.0" - resolved "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz" - integrity sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA== +tslib@^2.0.0, tslib@^2.0.1, tslib@^2.1.0, tslib@^2.3.0, tslib@^2.4.0, tslib@^2.5.3: + version "2.6.3" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.3.tgz#0438f810ad7a9edcde7a241c3d80db693c8cbfe0" + integrity sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ== + +tslib@^2.8.0: + version "2.8.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.8.1.tgz#612efe4ed235d567e8aba5f2a5fab70280ade83f" + integrity sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w== tslint@~6.1.3: version "6.1.3" @@ -11045,7 +11050,7 @@ wrap-ansi@^6.2.0: wrap-ansi@^7.0.0: version "7.0.0" - resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== dependencies: ansi-styles "^4.0.0" @@ -11308,7 +11313,7 @@ zone.js@~0.10.3: resolved "https://registry.npmjs.org/zone.js/-/zone.js-0.10.3.tgz" integrity sha512-LXVLVEq0NNOqK/fLJo3d0kfzd4sxwn2/h67/02pjCjfKDxgx1i9QqpvtHD8CrBnSSwMw5+dy11O7FRX5mkO7Cg== -zone.js@~0.14.8: - version "0.14.10" - resolved "https://registry.npmjs.org/zone.js/-/zone.js-0.14.10.tgz" - integrity sha512-YGAhaO7J5ywOXW6InXNlLmfU194F8lVgu7bRntUF3TiG8Y3nBK0x1UJJuHUP/e8IyihkjCYqhCScpSwnlaSRkQ== +zone.js@~0.15.0: + version "0.15.0" + resolved "https://registry.yarnpkg.com/zone.js/-/zone.js-0.15.0.tgz#4810624e58d6dcf7b8379c1631765589917a0d8f" + integrity sha512-9oxn0IIjbCZkJ67L+LkhYWRyAy7axphb3VgE2MBDlOqnmHMPWGYMxJxBYFueFq/JGY2GMwS0rU+UCLunEmy5UA==