Closed Bug 936639 Opened 11 years ago Closed 11 years ago

[Messages][Drafts] Create Drafts object + tests

Categories

(Firefox OS Graveyard :: Gaia::SMS, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
1.3 Sprint 5 - 11/22

People

(Reporter: evhan55, Assigned: evhan55)

References

Details

Attachments

(1 file)

Create a Drafts object:

* contains a list of draft objects
* length
* push
* filter
* forEach
* delete
Assignee: nobody → evelyn
Target Milestone: --- → 1.3 Sprint 5 - 11/22
Component: Gaia → Gaia::SMS
- Drafts Singleton
    - Adds, deletes, clears Draft objects
    - Loads and stores Draft objects from storage
    - Fetches all Draft objects for a thread id
- Drafts.List object
    - Array-list holder for Draft objects
    - has readonly accessor for length
    - has forEach to run callback on all contained Draft objects
- Draft object
    - standalone class to describe fields for a Draft instance
- Tests
    - Drafts: unit tests for adding, deletion, clearing, storing, loading, fetching by id
    - Draft.List: unit tests for length, forEach
    - Draft: no unit tests yet
Attachment #833097 - Flags: review?(waldron.rick)
Comment on attachment 833097 [details] [review]
https://github.com/mozilla-b2g/gaia/pull/13756

Needs to be broken into two PRs:

- Bug 936639
- Bug 931083
Attachment #833097 - Flags: review?(waldron.rick) → review-
Summary: [Messages][Drafts] Create Drafts module/constructor + tests → [Messages][Drafts] Create Drafts object + tests
Comment on attachment 833097 [details] [review]
https://github.com/mozilla-b2g/gaia/pull/13756

Resubmitting for review:

Removed all storage code and put back in it's own PR.
New PR comment:

- Drafts Singleton
    - Adds, deletes, clears Draft objects
    - Fetches all Draft objects for a thread id
- Drafts.List object
    - Array-like holder for Draft objects
    - has readonly accessor for length
    - has forEach to run callback on all contained Draft objects
- Draft object
    - standalone class to describe fields for a Draft instance
- Tests
    - Drafts: unit tests for adding, deleting, clearing, fetching by id
    - Draft.List: unit tests for length, forEach
    - Draft: no unit tests yet
Attachment #833097 - Flags: review- → review?
New PR comment:

- Drafts Singleton
    - Adds, deletes, clears Draft objects
    - Fetches all Draft objects for a thread id
- Drafts.List object
    - Array-like holder for Draft objects
    - has readonly accessor for length
    - has forEach to run callback on all contained Draft objects
- Draft object
    - standalone class to describe fields for a Draft instance
- Tests
    - Drafts: unit tests for adding, deleting, clearing, fetching by id
    - Draft.List: unit tests for length, forEach
    - Draft: unit tests for new Draft from empty object and from existing Draft
- Issues
    - Not sure if recipients should be stored as Array or String
Rick, I took your feedback from the PR and from IRC and pushed an updated commit @ Nov 15 11:28pm Eastern.
(In reply to Evelyn Eastmond [:evhan55] from comment #6)
> Rick, I took your feedback from the PR and from IRC and pushed an updated
> commit @ Nov 15 11:28pm Eastern.

Awesome, reviewed and a few comments. I think this is likely the last round and then I will r+
Comment on attachment 833097 [details] [review]
https://github.com/mozilla-b2g/gaia/pull/13756

Resubmitting for review.
It's looking clean, thanks very much for all the help, I'm happy.
Attachment #833097 - Flags: review? → review?(waldron.rick)
https://github.com/mozilla-b2g/gaia/commit/3519431a4775c2e0c3567b00e572a8a4fc19730c

Landed on master by rwaldron
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: