-
Notifications
You must be signed in to change notification settings - Fork 113
test(card): Closes #2906 Test system-addon Card UI #3086
Conversation
There was a problem hiding this 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})`)); |
There was a problem hiding this comment.
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", () => { |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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: ""}}) |
There was a problem hiding this comment.
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?
No description provided.