Skip to content

Commit aca00b0

Browse files
authored
update test snapshots (#700)
* update test snapshots * add changeset * set timeout
1 parent 8095383 commit aca00b0

File tree

7 files changed

+87
-79
lines changed

7 files changed

+87
-79
lines changed

.changeset/selfish-cobras-tap.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@status-im/js': patch
3+
---
4+
5+
update test snapshots

apps/wallet/src/data/api.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ test('should add wallet', async () => {
8282
})
8383

8484
expect(addedWallet.mnemonic).toBeDefined()
85-
})
85+
}, 6000)
8686

8787
test('should import wallet', async () => {
8888
await createAPI()
@@ -98,7 +98,7 @@ test('should import wallet', async () => {
9898
})
9999

100100
expect(importedWallet.mnemonic).toBe(mnemonic)
101-
})
101+
}, 6000)
102102

103103
test('should get wallet', async () => {
104104
await createAPI()
@@ -119,4 +119,4 @@ test('should get wallet', async () => {
119119
})
120120

121121
expect(returnedWallet.mnemonic).toBe(mnemonic)
122-
})
122+
}, 6000)

packages/status-js/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
"scripts": {
4747
"preinstall": "npx only-allow pnpm",
4848
"test": "vitest run",
49+
"test:update": "vitest run --update",
4950
"dev": "vite build --watch --mode development",
5051
"build": "vite build",
5152
"postbuild": "pnpm build:types",

packages/status-js/src/utils/compress-public-key.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@ test('should accept public key with a base prefix', () => {
2525
test('should throw error if public key is not a valid hex', () => {
2626
expect(() => {
2727
compressPublicKey('not a valid public key')
28-
}).toThrowErrorMatchingInlineSnapshot(`"Invalid public key"`)
28+
}).toThrowErrorMatchingInlineSnapshot(`[Error: Invalid public key]`)
2929
})

packages/status-js/src/utils/decompress-public-key.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ test('should accept public key with a base prefix', () => {
2626
test('should throw error if public key is not a valid hex', () => {
2727
expect(() => {
2828
decompressPublicKey('not a valid public key')
29-
}).toThrowErrorMatchingInlineSnapshot(`"Invalid public key"`)
29+
}).toThrowErrorMatchingInlineSnapshot(`[Error: Invalid public key]`)
3030
})

packages/status-js/src/utils/encode-url-data.test.ts

Lines changed: 73 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,17 @@ describe('Encode URL data', () => {
4545
'G2QBQJwFdqwxrBnNb57kP0irrJpuouIjS1WZqHS6A2txojsUHidyu3evaAO3GQQku5NCQXiwAYchBIMNyptts=MD9bZAwoTasraIMkjbS1uAD7oxsAQ53OAmQWCefyBuuXlAu6J7eKQRQhgg5tan75fFp9jwGIjBLbGhnyUht2qj5GWlSBp7_OXsHxgnr21xA2HgR9VGYYikQJA4tcQHDrQzg_ARC9KiOVDD6vgTCM9_CN0HJ1zxwP3w6nzgkDTNuvDCFD3Clqo6Cf_UNY2cNRlKTqj86G4gC2dUNSApwiq72BdGTtrleiRFPUhCbTRbmEG4YwFOs4EjBdJHHRiqjS5GYGc1dAdgcGr2BQ==============================================================================================================================================='
4646
decodeCommunityURLData(encodedData)
4747
}).toThrowErrorMatchingInlineSnapshot(`
48-
"[
48+
[ZodError: [
4949
{
50-
\\"code\\": \\"too_big\\",
51-
\\"maximum\\": 500,
52-
\\"type\\": \\"string\\",
53-
\\"inclusive\\": true,
54-
\\"exact\\": false,
55-
\\"message\\": \\"String must contain at most 500 character(s)\\",
56-
\\"path\\": []
50+
"code": "too_big",
51+
"maximum": 500,
52+
"type": "string",
53+
"inclusive": true,
54+
"exact": false,
55+
"message": "String must contain at most 500 character(s)",
56+
"path": []
5757
}
58-
]"
58+
]]
5959
`)
6060
})
6161

@@ -88,53 +88,53 @@ describe('Encode URL data', () => {
8888
const encodedData = 'Ow=='
8989
decodeChannelURLData(encodedData)
9090
}).toThrowErrorMatchingInlineSnapshot(`
91-
"[
91+
[ZodError: [
9292
{
93-
\\"code\\": \\"invalid_type\\",
94-
\\"expected\\": \\"string\\",
95-
\\"received\\": \\"undefined\\",
96-
\\"path\\": [
97-
\\"displayName\\"
93+
"code": "invalid_type",
94+
"expected": "string",
95+
"received": "undefined",
96+
"path": [
97+
"displayName"
9898
],
99-
\\"message\\": \\"Required\\"
99+
"message": "Required"
100100
},
101101
{
102-
\\"code\\": \\"invalid_type\\",
103-
\\"expected\\": \\"string\\",
104-
\\"received\\": \\"undefined\\",
105-
\\"path\\": [
106-
\\"description\\"
102+
"code": "invalid_type",
103+
"expected": "string",
104+
"received": "undefined",
105+
"path": [
106+
"description"
107107
],
108-
\\"message\\": \\"Required\\"
108+
"message": "Required"
109109
},
110110
{
111-
\\"code\\": \\"invalid_type\\",
112-
\\"expected\\": \\"string\\",
113-
\\"received\\": \\"undefined\\",
114-
\\"path\\": [
115-
\\"color\\"
111+
"code": "invalid_type",
112+
"expected": "string",
113+
"received": "undefined",
114+
"path": [
115+
"color"
116116
],
117-
\\"message\\": \\"Required\\"
117+
"message": "Required"
118118
},
119119
{
120-
\\"code\\": \\"invalid_type\\",
121-
\\"expected\\": \\"object\\",
122-
\\"received\\": \\"undefined\\",
123-
\\"path\\": [
124-
\\"community\\"
120+
"code": "invalid_type",
121+
"expected": "object",
122+
"received": "undefined",
123+
"path": [
124+
"community"
125125
],
126-
\\"message\\": \\"Required\\"
126+
"message": "Required"
127127
},
128128
{
129-
\\"code\\": \\"invalid_type\\",
130-
\\"expected\\": \\"string\\",
131-
\\"received\\": \\"undefined\\",
132-
\\"path\\": [
133-
\\"uuid\\"
129+
"code": "invalid_type",
130+
"expected": "string",
131+
"received": "undefined",
132+
"path": [
133+
"uuid"
134134
],
135-
\\"message\\": \\"Required\\"
135+
"message": "Required"
136136
}
137-
]"
137+
]]
138138
`)
139139
})
140140

@@ -160,53 +160,53 @@ describe('Encode URL data', () => {
160160
const encodedData = 'Ow=='
161161
decodeChannelURLData(encodedData)
162162
}).toThrowErrorMatchingInlineSnapshot(`
163-
"[
163+
[ZodError: [
164164
{
165-
\\"code\\": \\"invalid_type\\",
166-
\\"expected\\": \\"string\\",
167-
\\"received\\": \\"undefined\\",
168-
\\"path\\": [
169-
\\"displayName\\"
165+
"code": "invalid_type",
166+
"expected": "string",
167+
"received": "undefined",
168+
"path": [
169+
"displayName"
170170
],
171-
\\"message\\": \\"Required\\"
171+
"message": "Required"
172172
},
173173
{
174-
\\"code\\": \\"invalid_type\\",
175-
\\"expected\\": \\"string\\",
176-
\\"received\\": \\"undefined\\",
177-
\\"path\\": [
178-
\\"description\\"
174+
"code": "invalid_type",
175+
"expected": "string",
176+
"received": "undefined",
177+
"path": [
178+
"description"
179179
],
180-
\\"message\\": \\"Required\\"
180+
"message": "Required"
181181
},
182182
{
183-
\\"code\\": \\"invalid_type\\",
184-
\\"expected\\": \\"string\\",
185-
\\"received\\": \\"undefined\\",
186-
\\"path\\": [
187-
\\"color\\"
183+
"code": "invalid_type",
184+
"expected": "string",
185+
"received": "undefined",
186+
"path": [
187+
"color"
188188
],
189-
\\"message\\": \\"Required\\"
189+
"message": "Required"
190190
},
191191
{
192-
\\"code\\": \\"invalid_type\\",
193-
\\"expected\\": \\"object\\",
194-
\\"received\\": \\"undefined\\",
195-
\\"path\\": [
196-
\\"community\\"
192+
"code": "invalid_type",
193+
"expected": "object",
194+
"received": "undefined",
195+
"path": [
196+
"community"
197197
],
198-
\\"message\\": \\"Required\\"
198+
"message": "Required"
199199
},
200200
{
201-
\\"code\\": \\"invalid_type\\",
202-
\\"expected\\": \\"string\\",
203-
\\"received\\": \\"undefined\\",
204-
\\"path\\": [
205-
\\"uuid\\"
201+
"code": "invalid_type",
202+
"expected": "string",
203+
"received": "undefined",
204+
"path": [
205+
"uuid"
206206
],
207-
\\"message\\": \\"Required\\"
207+
"message": "Required"
208208
}
209-
]"
209+
]]
210210
`)
211211
})
212212
})

packages/status-js/src/utils/recover-public-key.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,5 +81,7 @@ test('should throw error when signature length is not 65 bytes', async () => {
8181

8282
expect(() =>
8383
recoverPublicKey(signature, payload),
84-
).toThrowErrorMatchingInlineSnapshot(`"Signature must be 65 bytes long"`)
84+
).toThrowErrorMatchingInlineSnapshot(
85+
`[Error: Signature must be 65 bytes long]`,
86+
)
8587
})

0 commit comments

Comments
 (0)