Skip to content
This repository has been archived by the owner on Feb 29, 2020. It is now read-only.

test(card): Closes #2906 Test system-addon Card UI #3086

Merged
merged 1 commit into from
Aug 8, 2017

Conversation

sarracini
Copy link
Contributor

No description provided.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 86.407% when pulling 5df24a3 on sarracini:gh2906 into 62be2b7 on mozilla:master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 86.407% when pulling 18de029 on sarracini:gh2906 into 62be2b7 on mozilla:master.

Copy link
Contributor

@piatra piatra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Just some small fixes required.

it("should display a title", () => assert.equal(wrapper.find(".card-title").text(), DEFAULT_PROPS.link.title));
it("should display a description", () => assert.equal(wrapper.find(".card-description").text(), DEFAULT_PROPS.link.description));
it("should display a host name", () => assert.equal(wrapper.find(".card-host-name").text(), "foo"));
it("should display an image if there is one, with the correct background", () => assert.equal(wrapper.find(".card-preview-image").props().style.backgroundImage, `url(${DEFAULT_PROPS.link.image})`));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you break this line up & 32 as well. Too long.

assert.equal(options, DEFAULT_PROPS.contextMenuOptions);
assert.equal(index, DEFAULT_PROPS.index);
});
it("should pass through the correct menu options to LinkMenu if overriden by individual card", () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo?

it("should display a host name", () => assert.equal(wrapper.find(".card-host-name").text(), "foo"));
it("should display an image if there is one, with the correct background", () => assert.equal(wrapper.find(".card-preview-image").props().style.backgroundImage, `url(${DEFAULT_PROPS.link.image})`));
it("should not show an image if there isn't one", () => {
delete DEFAULT_PROPS.link.image;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test is always green, regardless of this line.

// first dispatch call is the SendToMain message which will open a link in a window, and send some event data
assert.calledWith(DEFAULT_PROPS.dispatch.firstCall, ac.SendToMain({
type: at.OPEN_LINK,
data: Object.assign(DEFAULT_PROPS.link, {event: {altKey: "", button: "", ctrlKey: "", metaKey: "", shiftKey: ""}})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Events are not properly tested here. Your click call only provides preventDefault so the values for the events should be undefined not "".
Could you use DEFAULT_PROPS.dispatch.firstCall.args[0].data.event and test the events with some actual values?

@coveralls
Copy link

Coverage Status

Coverage remained the same at 86.407% when pulling f94a191 on sarracini:gh2906 into 49c40ba on mozilla:master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 86.407% when pulling 8ccfe99 on sarracini:gh2906 into 49c40ba on mozilla:master.

@sarracini sarracini removed their assignment Aug 4, 2017
@sarracini sarracini merged commit a51d45a into mozilla:master Aug 8, 2017
@as-pine-proxy
Copy link
Collaborator

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

Successfully merging this pull request may close these issues.

4 participants