@digitaldefiance/express-suite-test-utils 1.0.4 → 1.0.6

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.
package/README.md CHANGED
@@ -70,6 +70,14 @@ MIT
70
70
 
71
71
  ## ChangeLog
72
72
 
73
+ ### v1.0.6
74
+
75
+ - Add react mocks
76
+
77
+ ### v1.0.5
78
+
79
+ - Add secp256k to BSON mock
80
+
73
81
  ### v1.0.4
74
82
 
75
83
  - Add BSON mock
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digitaldefiance/express-suite-test-utils",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "Test utilities for Digital Defiance Express Suite",
5
5
  "main": "src/index.js",
6
6
  "types": "src/index.d.ts",
package/src/index.d.ts CHANGED
@@ -2,4 +2,5 @@ export * from './lib/to-throw-type';
2
2
  export * from './lib/console';
3
3
  export * from './lib/localStorage-mock';
4
4
  export * from './lib/bson-mock';
5
+ export * from './lib/react-mocks';
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../packages/digitaldefiance-express-suite-test-utils/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../packages/digitaldefiance-express-suite-test-utils/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC"}
package/src/index.js CHANGED
@@ -5,3 +5,4 @@ tslib_1.__exportStar(require("./lib/to-throw-type"), exports);
5
5
  tslib_1.__exportStar(require("./lib/console"), exports);
6
6
  tslib_1.__exportStar(require("./lib/localStorage-mock"), exports);
7
7
  tslib_1.__exportStar(require("./lib/bson-mock"), exports);
8
+ tslib_1.__exportStar(require("./lib/react-mocks"), exports);
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Mock bson module for Jest tests
2
+ * Mock bson and crypto modules for Jest tests
3
3
  */
4
4
  export declare class ObjectId {
5
5
  id: string;
@@ -29,4 +29,19 @@ export declare class Timestamp {
29
29
  }
30
30
  export declare class UUID {
31
31
  }
32
+ export declare const secp256k1: {
33
+ CURVE: {
34
+ p: bigint;
35
+ n: bigint;
36
+ };
37
+ };
38
+ declare const _default: {
39
+ secp256k1: {
40
+ CURVE: {
41
+ p: bigint;
42
+ n: bigint;
43
+ };
44
+ };
45
+ };
46
+ export default _default;
32
47
  //# sourceMappingURL=bson-mock.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"bson-mock.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-test-utils/src/lib/bson-mock.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,qBAAa,QAAQ;IACA,EAAE,EAAE,MAAM;gBAAV,EAAE,GAAE,MAAmC;IAC1D,QAAQ,IAAI,MAAM;IAGlB,WAAW,IAAI,MAAM;CAGtB;AAED,qBAAa,MAAM;CAAG;AACtB,qBAAa,IAAI;CAAG;AACpB,qBAAa,KAAK;CAAG;AACrB,qBAAa,UAAU;CAAG;AAC1B,qBAAa,MAAM;CAAG;AACtB,qBAAa,KAAK;CAAG;AACrB,qBAAa,IAAI;CAAG;AACpB,qBAAa,MAAM;CAAG;AACtB,qBAAa,MAAM;CAAG;AACtB,qBAAa,SAAS;CAAG;AACzB,qBAAa,IAAI;CAAG"}
1
+ {"version":3,"file":"bson-mock.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-test-utils/src/lib/bson-mock.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,qBAAa,QAAQ;IACA,EAAE,EAAE,MAAM;gBAAV,EAAE,GAAE,MAAmC;IAC1D,QAAQ,IAAI,MAAM;IAGlB,WAAW,IAAI,MAAM;CAGtB;AAED,qBAAa,MAAM;CAAG;AACtB,qBAAa,IAAI;CAAG;AACpB,qBAAa,KAAK;CAAG;AACrB,qBAAa,UAAU;CAAG;AAC1B,qBAAa,MAAM;CAAG;AACtB,qBAAa,KAAK;CAAG;AACrB,qBAAa,IAAI;CAAG;AACpB,qBAAa,MAAM;CAAG;AACtB,qBAAa,MAAM;CAAG;AACtB,qBAAa,SAAS;CAAG;AACzB,qBAAa,IAAI;CAAG;AAGpB,eAAO,MAAM,SAAS;;;;;CAKrB,CAAC;;;;;;;;;AAGF,wBAA6B"}
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  /**
3
- * Mock bson module for Jest tests
3
+ * Mock bson and crypto modules for Jest tests
4
4
  */
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.UUID = exports.Timestamp = exports.MinKey = exports.MaxKey = exports.Long = exports.Int32 = exports.Double = exports.Decimal128 = exports.DBRef = exports.Code = exports.Binary = exports.ObjectId = void 0;
6
+ exports.secp256k1 = exports.UUID = exports.Timestamp = exports.MinKey = exports.MaxKey = exports.Long = exports.Int32 = exports.Double = exports.Decimal128 = exports.DBRef = exports.Code = exports.Binary = exports.ObjectId = void 0;
7
7
  class ObjectId {
8
8
  id;
9
9
  constructor(id = '000000000000000000000000') {
@@ -50,3 +50,12 @@ exports.Timestamp = Timestamp;
50
50
  class UUID {
51
51
  }
52
52
  exports.UUID = UUID;
53
+ // Mock secp256k1 for ethereum crypto
54
+ exports.secp256k1 = {
55
+ CURVE: {
56
+ p: BigInt(0),
57
+ n: BigInt(0),
58
+ },
59
+ };
60
+ // Default export for ethereum-cryptography
61
+ exports.default = { secp256k1: exports.secp256k1 };
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Mock utilities for React component testing
3
+ */
4
+ /**
5
+ * Mock timezones for testing
6
+ */
7
+ export declare const mockTimezones: string[];
8
+ /**
9
+ * Get initial timezone mock
10
+ */
11
+ export declare const mockGetInitialTimezone: () => string;
12
+ /**
13
+ * Mock RegisterForm props
14
+ */
15
+ export declare const mockRegisterFormProps: {
16
+ timezones: string[];
17
+ getInitialTimezone: () => string;
18
+ onSubmit: jest.Mock<any, any, any>;
19
+ };
20
+ //# sourceMappingURL=react-mocks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"react-mocks.d.ts","sourceRoot":"","sources":["../../../../../packages/digitaldefiance-express-suite-test-utils/src/lib/react-mocks.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,eAAO,MAAM,aAAa,UAOzB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,sBAAsB,QAAO,MAAe,CAAC;AAE1D;;GAEG;AACH,eAAO,MAAM,qBAAqB;;8BALQ,MAAM;;CAS/C,CAAC"}
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ /**
3
+ * Mock utilities for React component testing
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.mockRegisterFormProps = exports.mockGetInitialTimezone = exports.mockTimezones = void 0;
7
+ /**
8
+ * Mock timezones for testing
9
+ */
10
+ exports.mockTimezones = [
11
+ 'America/New_York',
12
+ 'America/Los_Angeles',
13
+ 'Europe/London',
14
+ 'Europe/Paris',
15
+ 'Asia/Tokyo',
16
+ 'UTC',
17
+ ];
18
+ /**
19
+ * Get initial timezone mock
20
+ */
21
+ const mockGetInitialTimezone = () => 'UTC';
22
+ exports.mockGetInitialTimezone = mockGetInitialTimezone;
23
+ /**
24
+ * Mock RegisterForm props
25
+ */
26
+ exports.mockRegisterFormProps = {
27
+ timezones: exports.mockTimezones,
28
+ getInitialTimezone: exports.mockGetInitialTimezone,
29
+ onSubmit: jest.fn().mockResolvedValue({ success: true, message: 'Success' }),
30
+ };