wip change schema version to tuple #789
Annotations
12 errors
lint:
src/handlers/shared/saleor-webhook-validator.ts#L7
'SaleorSchemaVersion' is defined but never used
|
lint
Process completed with exit code 1.
|
src/util/schema-version.test.ts > parseSchemaVersion > Parses version string from: '3' to: null:
src/util/schema-version.ts#L3
Error: Cant parse Saleor schema version
❯ src/util/schema-version.ts:3:24
❯ src/util/schema-version.test.ts:3:1
|
src/util/schema-version.test.ts > parseSchemaVersion > Parses version string from: '3.19' to: 3.19:
src/util/schema-version.test.ts#L42
AssertionError: expected [ 3, 19 ] to be 3.19 // Object.is equality
- Expected:
3.19
+ Received:
[
3,
19,
]
❯ src/util/schema-version.test.ts:42:46
|
src/util/schema-version.test.ts > parseSchemaVersion > Parses version string from: '3.19.1' to: 3.19:
src/util/schema-version.test.ts#L42
AssertionError: expected [ 3, 19 ] to be 3.19 // Object.is equality
- Expected:
3.19
+ Received:
[
3,
19,
]
❯ src/util/schema-version.test.ts:42:46
|
src/util/schema-version.test.ts > parseSchemaVersion > Parses version string from: 'malformed' to: null:
src/util/schema-version.ts#L3
Error: Cant parse Saleor schema version
❯ src/util/schema-version.ts:3:24
❯ src/util/schema-version.test.ts:3:1
|
src/util/schema-version.test.ts > parseSchemaVersion > Parses version string from: 'malformed.raw' to: null:
src/util/schema-version.ts#L3
Error: Cant parse Saleor schema version
❯ src/util/schema-version.ts:3:24
❯ src/util/schema-version.test.ts:3:1
|
src/util/schema-version.test.ts > parseSchemaVersion > Parses version string from: 'malformed.raw.version' to: null:
src/util/schema-version.ts#L3
Error: Cant parse Saleor schema version
❯ src/util/schema-version.ts:3:24
❯ src/util/schema-version.test.ts:3:1
|
src/util/schema-version.test.ts > parseSchemaVersion > Parses version string from: null to: null:
src/util/schema-version.ts#L3
Error: Cant parse Saleor schema version
❯ src/util/schema-version.ts:3:24
❯ src/util/schema-version.test.ts:3:1
|
src/util/schema-version.test.ts > parseSchemaVersion > Parses version string from: undefined to: null:
src/util/schema-version.ts#L3
Error: Cant parse Saleor schema version
❯ src/util/schema-version.ts:3:24
❯ src/util/schema-version.test.ts:3:1
|
src/handlers/shared/saleor-webhook-validator.test.ts > SaleorWebhookValidator > Throws if version header is missing:
src/handlers/shared/saleor-webhook-validator.test.ts#L251
AssertionError: expected { result: 'ok', context: { …(5) } } to match object { result: 'ok', …(1) }
(9 matching properties omitted from actual)
- Expected
+ Received
{
- "context": ObjectContaining {
- "schemaVersion": null,
+ "context": {
+ "authData": {
+ "appId": "mock-app-id",
+ "jwks": "{}",
+ "saleorApiUrl": "https://example.com/graphql/",
+ "token": "mock-token",
+ },
+ "baseUrl": "https://example-app.com/api",
+ "event": "product_updated",
+ "payload": {},
+ "schemaVersion": [
+ 3,
+ 20,
+ ],
},
"result": "ok",
}
❯ src/handlers/shared/saleor-webhook-validator.test.ts:251:20
|
src/handlers/shared/saleor-webhook-validator.test.ts > SaleorWebhookValidator > Returns success on valid request with signature passing validation against jwks in auth data:
src/handlers/shared/saleor-webhook-validator.test.ts#L269
AssertionError: expected { result: 'ok', context: { …(5) } } to match object { result: 'ok', …(1) }
(9 matching properties omitted from actual)
- Expected
+ Received
{
- "context": ObjectContaining {
+ "context": {
+ "authData": {
+ "appId": "mock-app-id",
+ "jwks": "{}",
+ "saleorApiUrl": "https://example.com/graphql/",
+ "token": "mock-token",
+ },
"baseUrl": "https://example-app.com/api",
"event": "product_updated",
"payload": {},
- "schemaVersion": null,
+ "schemaVersion": [
+ 3,
+ 20,
+ ],
},
"result": "ok",
}
❯ src/handlers/shared/saleor-webhook-validator.test.ts:269:20
|