Closed Bug 1108275 Opened 10 years ago Closed 10 years ago

Add tests for when the IRC topic is settable.

Categories

(Chat Core :: IRC, defect)

defect
Not set
minor

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: clokep, Assigned: clokep)

Details

Attachments

(1 file, 1 obsolete file)

Attached patch irc-test-modes.diff (obsolete) — Splinter Review
This adds a couple of tests for setting the mode. It's not exhaustive, but covers when the topic is settable or not.
Attachment #8532838 - Flags: review?(aleth)
Assignee: nobody → clokep
Status: NEW → ASSIGNED
Comment on attachment 8532838 [details] [diff] [review] irc-test-modes.diff Review of attachment 8532838 [details] [diff] [review]: ----------------------------------------------------------------- ::: chat/protocols/irc/irc.js @@ +322,5 @@ > if (this._participants.has(aNick)) > return this._participants.get(aNick); > > let participant = new ircParticipant(aNick, this); > + this._participants.set(participant.name, participant); Why this change? this._participants is a normalizedMap. I would be concerned if the change had any effect. ::: chat/protocols/irc/test/test_setMode.js @@ +25,5 @@ > +// Test joining a channel, then being set as op. > +function test_topicSettable() { > + let channel = new irc.ircChannel(new FakeAccount(), "#test", "nick"); > + // We're not in the room yet, so the topic is NOT editable. > + equal(channel.topicSettable, false); It is possible to add the comment explaining the test as a third parameter in equal(), that way it's automatically printed to the log if the test fails, iirc. Worth considering...
Comment on attachment 8532838 [details] [diff] [review] irc-test-modes.diff (In reply to aleth [:aleth] from comment #1) > Comment on attachment 8532838 [details] [diff] [review] > irc-test-modes.diff > > Review of attachment 8532838 [details] [diff] [review]: > ----------------------------------------------------------------- > > ::: chat/protocols/irc/irc.js > @@ +322,5 @@ > > if (this._participants.has(aNick)) > > return this._participants.get(aNick); > > > > let participant = new ircParticipant(aNick, this); > > + this._participants.set(participant.name, participant); > > Why this change? this._participants is a normalizedMap. I would be concerned > if the change had any effect. Hmm...I think this is a problem with me mocking out the test poorly. I'll look more into this.
Attachment #8532838 - Flags: review?(aleth) → review-
Attached patch Patch v2Splinter Review
Thanks for pointing out this flaw! I think you'll find the new version better.
Attachment #8532838 - Attachment is obsolete: true
Attachment #8533445 - Flags: review?(aleth)
Comment on attachment 8533445 [details] [diff] [review] Patch v2 Review of attachment 8533445 [details] [diff] [review]: ----------------------------------------------------------------- Thanks! :-)
Attachment #8533445 - Flags: review?(aleth) → review+
Keywords: checkin-needed
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → 1.6
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: