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)
Fri, Mar 22, 9:13 PM
Unknown Object (File)
Fri, Mar 8, 10:04 AM
Unknown Object (File)
Wed, Mar 6, 5:22 PM
Unknown Object (File)
Wed, Mar 6, 4:22 PM
Unknown Object (File)
Wed, Mar 6, 2:51 PM
Unknown Object (File)
Wed, Mar 6, 2:43 PM
Unknown Object (File)
Feb 19 2024, 6:18 PM
Unknown Object (File)
Feb 19 2024, 6:17 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.