Page MenuHomePhabricator

[lib] Introduce raw message info validators
ClosedPublic

Authored by michal on Apr 21 2023, 8:08 AM.
Tags
None
Referenced Files
F3396504: D7567.id26057.diff
Sun, Dec 1, 12:55 PM
F3396442: D7567.id25544.diff
Sun, Dec 1, 12:21 PM
Unknown Object (File)
Fri, Nov 29, 1:42 PM
Unknown Object (File)
Fri, Nov 29, 8:21 AM
Unknown Object (File)
Fri, Nov 29, 8:03 AM
Unknown Object (File)
Mon, Nov 25, 8:22 PM
Unknown Object (File)
Mon, Nov 25, 6:18 PM
Unknown Object (File)
Wed, Nov 20, 4:20 PM
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.