Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions e2e/tsconfig.e2e.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@
"target": "es5",
"types": [
"jasmine",
"jasminewd2",
"node"
]
}
}
}
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hmcts/ccd-case-ui-toolkit",
"version": "7.3.54",
"version": "7.3.54-exui-1855-rc-1",
"engines": {
"node": ">=20.19.0"
},
Expand Down Expand Up @@ -104,8 +104,7 @@
"@storybook/manager-webpack4": "^6.5.10",
"@storybook/preset-scss": "^1.0.3",
"@storybook/testing-library": "^0.2.0",
"@types/jasmine": "~2.8.0",
"@types/jasminewd2": "^2.0.3",
"@types/jasmine": "~5.1.0",
"@types/node": "^20.19.0",
"@types/pegjs": "^0.10.0",
"@types/underscore": "^1.11.4",
Expand Down
2 changes: 1 addition & 1 deletion projects/ccd-case-ui-toolkit/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hmcts/ccd-case-ui-toolkit",
"version": "7.3.54",
"version": "7.3.54-exui-1855-rc-1",
"engines": {
"node": ">=20.19.0"
},
Expand Down
28 changes: 28 additions & 0 deletions projects/ccd-case-ui-toolkit/src/jasmine-compat.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Keeps the existing test suite compatible with newer, stricter Jasmine typings.
declare function spyOn<T>(object: T, method: string): jasmine.Spy;

declare namespace jasmine {
interface SpyAnd<Fn extends Func> {
returnValue(val: any): Spy<Fn>;
returnValues(...values: any[]): Spy<Fn>;
callFake(fn: Func): Spy<Fn>;
}

interface FunctionMatchers<Fn extends Func> {
toHaveBeenCalledWith(...params: any[]): void;
toHaveBeenCalledOnceWith(...params: any[]): void;
}

interface Matchers<T> {
toBe(expected: any, expectationFailOutput?: any): void;
toEqual(expected: any, expectationFailOutput?: any): void;
}

interface Calls<Fn extends Func> {
argsFor(index: number): any[];
allArgs(): ReadonlyArray<any[]>;
all(): ReadonlyArray<CallInfo<Func>>;
mostRecent(): CallInfo<Func>;
first(): CallInfo<Func>;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,7 @@ describe('QueryWriteDateInputComponent', () => {

describe('updateDate', () => {
it('should invoke onChange and onTouched when updateDate is called with a valid date input', () => {
// @ts-expect-error - private method
const onChangeSpy = spyOn(component, 'onChange');
// @ts-expect-error - private method
const onTouchedSpy = spyOn(component, 'onTouched');
component.day = 7;
component.month = 6;
Expand All @@ -85,9 +83,7 @@ describe('QueryWriteDateInputComponent', () => {
});

it('should invoke onChange with null when updateDate is called with an invalid date input', () => {
// @ts-expect-error - private method
const onChangeSpy = spyOn(component, 'onChange');
// @ts-expect-error - private method
const onTouchedSpy = spyOn(component, 'onTouched');
component.day = 35;
component.month = 15;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ describe('HttpService', () => {

httpService.get(URL, options);

const headers = httpMock.get.calls.mostRecent().args[1].headers;
const headers = httpMock.get.calls.mostRecent().args[1].headers as HttpHeaders;
expect(headers.get('Content-Type')).toEqual(CONTENT_TYPE_HEADER_VALUE);
expect(headers.get('Accept')).toEqual(ACCEPT_HEADER_VALUE);
}));
Expand All @@ -140,7 +140,7 @@ describe('HttpService', () => {

httpService.get(URL, options);

const headers = httpMock.get.calls.mostRecent().args[1].headers;
const headers = httpMock.get.calls.mostRecent().args[1].headers as HttpHeaders;
expect(headers.get('Content-Type')).toEqual('application/json');
expect(headers.get('Accept')).toEqual('application/json');
}));
Expand Down Expand Up @@ -220,7 +220,7 @@ describe('HttpService', () => {

httpService.post(URL, BODY, options);

const headers = httpMock.post.calls.mostRecent().args[2].headers;
const headers = httpMock.post.calls.mostRecent().args[2].headers as HttpHeaders;
expect(headers.get('Content-Type')).toEqual('application/json');
expect(headers.get('Accept')).toEqual('application/json');
}));
Expand Down Expand Up @@ -284,7 +284,7 @@ describe('HttpService', () => {

httpService.put(URL, BODY, options);

const headers = httpMock.put.calls.mostRecent().args[2].headers;
const headers = httpMock.put.calls.mostRecent().args[2].headers as HttpHeaders;
expect(headers.get('Content-Type')).toEqual('application/json');
expect(headers.get('Accept')).toEqual('application/json');
}));
Expand Down Expand Up @@ -348,7 +348,7 @@ describe('HttpService', () => {

httpService.delete(URL, options);

const headers = httpMock.delete.calls.mostRecent().args[1].headers;
const headers = httpMock.delete.calls.mostRecent().args[1].headers as HttpHeaders;
expect(headers.get('Content-Type')).toEqual('application/json');
expect(headers.get('Accept')).toEqual('application/json');
}));
Expand Down
27 changes: 5 additions & 22 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3425,8 +3425,7 @@ __metadata:
"@storybook/manager-webpack4": "npm:^6.5.10"
"@storybook/preset-scss": "npm:^1.0.3"
"@storybook/testing-library": "npm:^0.2.0"
"@types/jasmine": "npm:~2.8.0"
"@types/jasminewd2": "npm:^2.0.3"
"@types/jasmine": "npm:~5.1.0"
"@types/node": "npm:^20.19.0"
"@types/pegjs": "npm:^0.10.0"
"@types/underscore": "npm:^1.11.4"
Expand Down Expand Up @@ -8036,26 +8035,10 @@ __metadata:
languageName: node
linkType: hard

"@types/jasmine@npm:*":
version: 5.1.13
resolution: "@types/jasmine@npm:5.1.13"
checksum: 10/f873c5650202b339866244a1c019fecc7abe47694cf8899ef17e965aae51b57cd777bb7ab813a61c4482cbc436eb0c18f02ff8def320999e403a56bd5a80d21e
languageName: node
linkType: hard

"@types/jasmine@npm:~2.8.0":
version: 2.8.23
resolution: "@types/jasmine@npm:2.8.23"
checksum: 10/01d2c2ed4d651147ebc6ff690a5795f6a33d007f5965cfb7f76bda104f9cc900ecebbd26046cf59a994a1e6ba32feafe5625777504e600616f99ffb2ec12f48c
languageName: node
linkType: hard

"@types/jasminewd2@npm:^2.0.3":
version: 2.0.13
resolution: "@types/jasminewd2@npm:2.0.13"
dependencies:
"@types/jasmine": "npm:*"
checksum: 10/a661e1add2d7c0582b05e79fcdbc0297fa4292b38b1273e2970d88d0775c85ecc322e1417c84826b5e6caeceab4dc267f5f00300c0c11d0fc459601057698700
"@types/jasmine@npm:~5.1.0":
version: 5.1.15
resolution: "@types/jasmine@npm:5.1.15"
checksum: 10/e86a962c153ff91ffe3c65a633578a5e3f6e065e58268c00e839b03dac6792b1e0a2afca216ccfa1e31647e49ef1a935332242350dca91a2940ad883643abd04
languageName: node
linkType: hard

Expand Down
Loading