Skip to content

Commit

Permalink
updates version and passes failing test (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
rizwan-ishtiaq authored Mar 11, 2020
1 parent f17217d commit 9cc7008
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 18 deletions.
43 changes: 31 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "simple-react-notifications",
"version": "1.2.14",
"version": "1.2.15",
"description": "Tiny react.js notification library (1kb gzip).",
"main": "dist/index.js",
"module": "dist/index.es.js",
Expand Down
10 changes: 5 additions & 5 deletions src/NotificationContainer/NotificationContainer.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,18 @@ import NotificationContainer from "./NotificationContainer";
describe("<NotificationContainer />", () => {
it("should render correctly with default props", () => {
const wrapper = shallow(
<NotificationContainer message="Your item has been updated." />
<NotificationContainer id={1} cleared={jest.fn} message="Your item has been updated."/>
);
expect(wrapper).toMatchSnapshot();
});

it("should render multiple items", () => {
const wrapper = mount(
<NotificationContainer message="Your item has been updated." />
<NotificationContainer id={1} cleared={jest.fn} message="Your item has been updated." />
);
wrapper.setProps({ message: "Done! Check your email." });
wrapper.setProps({ message: "Dark theme is enabled" });
wrapper.setProps({ message: "Done! Check your email.", id:2, cleared:jest.fn });
wrapper.setProps({ message: "Dark theme is enabled", id:3, cleared:jest.fn });
wrapper.update();
expect(wrapper.find(".notification-item").length).toEqual(3);
expect(wrapper.find(".info").length).toEqual(2);
});
});

0 comments on commit 9cc7008

Please sign in to comment.