Page MenuHomePhabricator

[lib] Introduce raw message info validators
ClosedPublic

Authored by michal on Apr 21 2023, 8:08 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Dec 23, 8:40 AM
Unknown Object (File)
Fri, Dec 20, 9:35 AM
Unknown Object (File)
Sun, Dec 15, 10:37 PM
Unknown Object (File)
Sun, Dec 15, 10:37 PM
Unknown Object (File)
Sun, Dec 15, 10:37 PM
Unknown Object (File)
Sun, Dec 15, 10:37 PM
Unknown Object (File)
Sun, Dec 15, 10:37 PM
Unknown Object (File)
Sun, Dec 15, 10:36 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
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

tomek added inline comments.
lib/types/validation.test.js
317–340 ↗(On Diff #25544)

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

350–352 ↗(On Diff #25544)

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.