Skip to content

Instantly share code, notes, and snippets.

@carlosble
Created April 5, 2017 18:27
Show Gist options
  • Save carlosble/88abb521cc594aeea29580a0155d6139 to your computer and use it in GitHub Desktop.
Save carlosble/88abb521cc594aeea29580a0155d6139 to your computer and use it in GitHub Desktop.
Populate the store with server data
it("renders the invoice coming from server", (done) => {
const invoice = {
reference: '0001',
amount: '10.00',
};
spyNotifier.slowOperationFinished = () => {
let billRow = page.find(BillsTable).first().find(BillRow);
expect(billRow.length).toBe(1);
done();
};
stubApi.getInvoices = () =>{
return Promise.resolve([invoice]);
};
createPage();
});
function createPage() {
let BillsPage = createBillsPage(stubApi, spyNotifier);
page = mount(
<Provider store={store}>
<BillsPage/>
</Provider>);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment