Page MenuHomePhabricator

[lib] Introduce raw message info validators
ClosedPublic

Authored by michal on Apr 21 2023, 8:08 AM.
Tags
None
Referenced Files
F1676752: D7567.diff
Mon, Apr 29, 2:35 AM
Unknown Object (File)
Wed, Apr 17, 2:46 AM
Unknown Object (File)
Mon, Apr 15, 3:37 PM
Unknown Object (File)
Fri, Apr 12, 6:26 PM
Unknown Object (File)
Wed, Apr 10, 10:43 AM
Unknown Object (File)
Sat, Apr 6, 2:14 PM
Unknown Object (File)
Fri, Apr 5, 4:59 AM
Unknown Object (File)
Fri, Apr 5, 4:59 AM
Subscribers

Details

Summary

Add validators for RawMessageInfo and inner types and tests for each message type. In tests all message examples are taken from the app except for change role, unsupported, edit message and pin message which I wrote manually.

Depends on D7566

Test Plan

Run yarn jest

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

tomek added inline comments.
lib/types/validation.test.js
317–340

Wondering if it might be beneficial to create a validator field in message spec

350–352

Should we add more descriptive error message? true !== false won't be too useful when debugging.

This revision is now accepted and ready to land.Apr 25 2023, 7:30 AM

Updated test descriptions. Added validator to message spec in another diff.