Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@agnanachandran
Created February 15, 2018 21:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save agnanachandran/3428b22bc7f9444e6da0f1fce8e37000 to your computer and use it in GitHub Desktop.
Save agnanachandran/3428b22bc7f9444e6da0f1fce8e37000 to your computer and use it in GitHub Desktop.
tests/notifications_view_container_test.tsx
describe('NotificationsViewContainer', () => {
it('should render NotificationsView', () => {
const readNotification = new Notification('1', 'read', 100, true);
const unreadNotification = new Notification('2', 'unread', 101, false);
const unreadNotification2 = new Notification('3', 'unread2', 102, false);
const notifications = [readNotification, unreadNotification, unreadNotification2];
const notificationsStore = NotificationsStore.initialize(notifications);
const wrapper = mount(
<NotificationsViewContainer
notificationsStore={ notificationsStore }
/>
);
const notificationsViewElements = wrapper.find(NotificationsView);
expect(notificationsViewElements).to.have.length(1);
expect(notificationsViewElements.props().unreadNotifications).to.have.length(2);
expect(notificationsViewElements.props().readNotifications).to.have.length(1);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment