@karpeleslab/klbfw 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/index.d.ts +81 -0
  2. package/package.json +8 -1
  3. package/CLAUDE.md +0 -50
  4. package/coverage/clover.xml +0 -835
  5. package/coverage/coverage-final.json +0 -9
  6. package/coverage/lcov-report/base.css +0 -224
  7. package/coverage/lcov-report/block-navigation.js +0 -87
  8. package/coverage/lcov-report/cookies.js.html +0 -334
  9. package/coverage/lcov-report/favicon.png +0 -0
  10. package/coverage/lcov-report/fw-wrapper.js.html +0 -163
  11. package/coverage/lcov-report/index.html +0 -131
  12. package/coverage/lcov-report/index.js.html +0 -196
  13. package/coverage/lcov-report/internal.js.html +0 -604
  14. package/coverage/lcov-report/klbfw/cookies.js.html +0 -490
  15. package/coverage/lcov-report/klbfw/fw-wrapper.js.html +0 -745
  16. package/coverage/lcov-report/klbfw/index.html +0 -206
  17. package/coverage/lcov-report/klbfw/index.js.html +0 -235
  18. package/coverage/lcov-report/klbfw/internal.js.html +0 -811
  19. package/coverage/lcov-report/klbfw/rest.js.html +0 -565
  20. package/coverage/lcov-report/klbfw/test/index.html +0 -116
  21. package/coverage/lcov-report/klbfw/test/setup.js.html +0 -1105
  22. package/coverage/lcov-report/klbfw/upload.js.html +0 -3487
  23. package/coverage/lcov-report/klbfw/util.js.html +0 -388
  24. package/coverage/lcov-report/prettify.css +0 -1
  25. package/coverage/lcov-report/prettify.js +0 -2
  26. package/coverage/lcov-report/rest.js.html +0 -472
  27. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  28. package/coverage/lcov-report/sorter.js +0 -196
  29. package/coverage/lcov-report/upload.js.html +0 -1789
  30. package/coverage/lcov-report/util.js.html +0 -313
  31. package/coverage/lcov.info +0 -1617
  32. package/test/README.md +0 -62
  33. package/test/api.test.js +0 -102
  34. package/test/cookies.test.js +0 -65
  35. package/test/integration.test.js +0 -481
  36. package/test/rest.test.js +0 -93
  37. package/test/setup.js +0 -341
  38. package/test/upload.test.js +0 -689
  39. package/test/util.test.js +0 -46
package/test/util.test.js DELETED
@@ -1,46 +0,0 @@
1
- 'use strict';
2
-
3
- const util = require('../util');
4
- const { setupSSRMode, setupClientMode, resetMocks } = require('./setup');
5
-
6
- describe('Utility Module', () => {
7
- beforeEach(() => {
8
- resetMocks();
9
-
10
- // Mock fetch response for i18n calls
11
- global.fetch = jest.fn().mockImplementation(() => {
12
- return Promise.resolve({
13
- ok: true,
14
- status: 200,
15
- json: jest.fn().mockResolvedValue({
16
- "hello": "Hello",
17
- "goodbye": "Goodbye"
18
- })
19
- });
20
- });
21
- });
22
-
23
- describe('getI18N', () => {
24
- test('fetches locale data with specified language', async () => {
25
- const i18n = await util.getI18N('en-US');
26
- expect(fetch).toHaveBeenCalledWith('/_special/locale/en-US.json');
27
- expect(i18n).toHaveProperty('hello', 'Hello');
28
- });
29
-
30
- test('uses FW.Locale if no language specified', async () => {
31
- // FW.Locale is set to en-US in setup
32
- const i18n = await util.getI18N();
33
- expect(fetch).toHaveBeenCalledWith('/_special/locale/en-US.json');
34
- expect(i18n).toHaveProperty('hello', 'Hello');
35
- });
36
- });
37
-
38
- describe('Utility Functions', () => {
39
- test('trimPrefix processes URL correctly', () => {
40
- const result = util.trimPrefix('/l/en-US/path');
41
- expect(result).toHaveLength(2);
42
- expect(result[0]).toHaveProperty('l', 'en-US');
43
- expect(result[1]).toBe('/path');
44
- });
45
- });
46
- });