Skip to content

Commit 219dd0e

Browse files
Merge pull request #9420 from JeraldJF/version-update
SB-I367: Client service version changes for constructor issues
2 parents 9e6cdc5 + aba102f commit 219dd0e

File tree

3 files changed

+28
-5
lines changed

3 files changed

+28
-5
lines changed

src/app/client/__mocks__/jsonld.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Mock for jsonld to avoid @digitalbazaar/http-client loading in tests
2+
3+
module.exports = {
4+
compact: jest.fn().mockResolvedValue({}),
5+
expand: jest.fn().mockResolvedValue([]),
6+
flatten: jest.fn().mockResolvedValue([]),
7+
frame: jest.fn().mockResolvedValue({}),
8+
fromRDF: jest.fn().mockResolvedValue({}),
9+
normalize: jest.fn().mockResolvedValue(''),
10+
toRDF: jest.fn().mockResolvedValue(''),
11+
__esModule: true,
12+
default: {
13+
compact: jest.fn().mockResolvedValue({}),
14+
expand: jest.fn().mockResolvedValue([]),
15+
flatten: jest.fn().mockResolvedValue([]),
16+
frame: jest.fn().mockResolvedValue({}),
17+
fromRDF: jest.fn().mockResolvedValue({}),
18+
normalize: jest.fn().mockResolvedValue(''),
19+
toRDF: jest.fn().mockResolvedValue(''),
20+
}
21+
};

src/app/client/jest-global-mocks.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,12 @@ Object.defineProperty(document.body.style, 'transform', {
6363

6464
HTMLCanvasElement.prototype.getContext = <typeof HTMLCanvasElement.prototype.getContext>jest.fn();
6565

66-
// Polyfill for TextEncoder and TextDecoder
67-
const { TextEncoder, TextDecoder } = require('util');
68-
global.TextEncoder = TextEncoder;
69-
global.TextDecoder = TextDecoder;
66+
// Polyfill for TextEncoder and TextDecoder (if not already set)
67+
if (typeof global.TextEncoder === 'undefined') {
68+
const { TextEncoder, TextDecoder } = require('util');
69+
global.TextEncoder = TextEncoder;
70+
global.TextDecoder = TextDecoder;
71+
}
7072

7173
// Polyfill for crypto.randomUUID if needed
7274
if (!global.crypto) {

src/app/client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
"@ngx-translate/http-loader": "7.0.0",
6161
"@project-sunbird/chatbot-client": "4.0.0",
6262
"@project-sunbird/ckeditor-build-classic": "4.1.3",
63-
"@project-sunbird/client-services": "8.0.2",
63+
"@project-sunbird/client-services": "8.0.6",
6464
"@project-sunbird/common-consumption": "7.0.12",
6565
"@project-sunbird/common-form-elements-full": "6.0.3",
6666
"@project-sunbird/discussions-ui": "5.4.0",

0 commit comments

Comments
 (0)