Skip to content
This repository has been archived by the owner. It is now read-only.

feat(sytemaddon): Implement sections API and dummy feed. Closes #2848. #2859

Merged
merged 6 commits into from Jul 17, 2017

Conversation

@AdamHillier
Copy link
Contributor

@AdamHillier AdamHillier commented Jul 14, 2017

No description provided.

@coveralls
Copy link

@coveralls coveralls commented Jul 14, 2017

Coverage Status

Coverage remained the same at 87.576% when pulling 54887fe on AdamHillier:gh2848 into f7944c7 on mozilla:master.

@coveralls
Copy link

@coveralls coveralls commented Jul 14, 2017

Coverage Status

Coverage remained the same at 87.576% when pulling cebb227 on AdamHillier:gh2848 into f7944c7 on mozilla:master.

@AdamHillier AdamHillier requested a review from sarracini Jul 14, 2017
@coveralls
Copy link

@coveralls coveralls commented Jul 14, 2017

Coverage Status

Coverage remained the same at 87.576% when pulling e5bc187 on AdamHillier:gh2848 into f7944c7 on mozilla:master.

@coveralls
Copy link

@coveralls coveralls commented Jul 17, 2017

Coverage Status

Coverage remained the same at 87.576% when pulling 9c37620 on AdamHillier:gh2848 into f7944c7 on mozilla:master.

@k88hudson k88hudson requested review from k88hudson and removed request for sarracini Jul 17, 2017
@k88hudson k88hudson assigned k88hudson and unassigned sarracini Jul 17, 2017
@k88hudson
Copy link
Member

@k88hudson k88hudson commented Jul 17, 2017

I'm taking this since @sarracini has a lot of review ATM

Copy link
Member

@k88hudson k88hudson left a comment

Looks great! Just a few small issues to fix up, but this looks close to ready to go. 👍

<h3 className="section-title">{title}</h3>
{initialized ? (<ul className="section-list">
{rows.map(url => url && <img src={url} />)}
</ul>) : <p>Uninitialized</p>}

This comment has been minimized.

@k88hudson

k88hudson Jul 17, 2017
Member

Perhaps just empty for now, printing the word Uninitialized seems a bit odd


.section-list {
padding: 0;
img {

This comment has been minimized.

@k88hudson

k88hudson Jul 17, 2017
Member

I'm assuming this is for your dummy section, I would probably just put it inline in that component to prevent having to remove stuff from here later.

That said, adding custom CSS might be something we'll have to figure out later

value
};
});

This comment has been minimized.

@k88hudson

k88hudson Jul 17, 2017
Member

I think the configuration situation in this file is getting too hard to read / needs some refactoring, but I'm OK with filing a separate issue for it.

This comment has been minimized.

@Mardak

Mardak Jul 30, 2017
Member

Was an issue filed for this? Why was this written as an Array to convert to a Map to convert to an Array to convert to a Map?

"https://c1.staticflickr.com/1/204/509363724_1f5d8813d0_b.jpg"
];

this.DummySectionFeed = class DummySectionFeed {

This comment has been minimized.

@k88hudson

k88hudson Jul 17, 2017
Member

Can you add a comment that explains why this exists

});
it("should remove the correct section on SECTION_DEREGISTER", () => {
const newState = Sections(oldState, {type: at.SECTION_DEREGISTER, data: "foo_bar_2"});
assert.equal(newState.length, 4);

This comment has been minimized.

@k88hudson

k88hudson Jul 17, 2017
Member

assert.lengthOf(newsState, 4)

This comment has been minimized.

@k88hudson

k88hudson Jul 17, 2017
Member

There are a few instances where you can use this

const newState = Sections(oldState, action);
assert.equal(newState.length, 6);
const insertedSection = newState.find(section => section.id === "foo_bar_5");
assert.ok(insertedSection && insertedSection.title === action.data.title);

This comment has been minimized.

@k88hudson

k88hudson Jul 17, 2017
Member

assert.propertyVal(insertedSection, "title", action.data.title);

const action = {type: at.SECTION_REGISTER, data: {id: "foo_bar_5", title: "Foo Bar 5"}};
const newState = Sections(oldState, action);
const insertedSection = newState.find(section => section.id === "foo_bar_5");
assert.ok(Array.isArray(insertedSection.rows) && insertedSection.rows.length === 0);

This comment has been minimized.

@k88hudson

k88hudson Jul 17, 2017
Member

You could just do assert.deepEqual(insertedSection.rows, []),

This comment has been minimized.

@k88hudson

k88hudson Jul 17, 2017
Member

If you want to test both assertions, i'd go with assert.isArray and assert.lengthOf.

@k88hudson
Copy link
Member

@k88hudson k88hudson commented Jul 17, 2017

@AdamHillier it might also be good to add a bit of documentation to the v2 docs folder since others will be using this. Feel free to do that as a separate PR.

@AdamHillier
Copy link
Contributor Author

@AdamHillier AdamHillier commented Jul 17, 2017

Happy to do the remaining points as separate PRs

@AdamHillier AdamHillier removed their assignment Jul 17, 2017
@coveralls
Copy link

@coveralls coveralls commented Jul 17, 2017

Coverage Status

Coverage remained the same at 87.576% when pulling b8f0aa7 on AdamHillier:gh2848 into f7944c7 on mozilla:master.

@k88hudson k88hudson merged commit 33cef85 into mozilla:master Jul 17, 2017
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage remained the same at 87.576%
Details
@Mardak
Copy link
Member

@Mardak Mardak commented Jul 18, 2017

This probably should have been squashed on merge as it ended up adding the individual Tidy up commits.

@Mardak
Copy link
Member

@Mardak Mardak commented Jul 18, 2017

Also, without squashing, trying to automatically bisect will lead to failures if it happens to end up in a middle of a set of related changes where later commits fix an earlier commit's breakage.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

6 participants