Skip to content

Instantly share code, notes, and snippets.

@mhamel06
Last active February 17, 2020 21:28
Show Gist options
  • Save mhamel06/bd595db1d46603048b8362b8a01d52e5 to your computer and use it in GitHub Desktop.
Save mhamel06/bd595db1d46603048b8362b8a01d52e5 to your computer and use it in GitHub Desktop.
it('should not call viewTransaction on first pending transaction: with harness', async()=>{
fixture.detectChanges();
spyOn(component, 'viewTransaction');
/*
* Find the first transactionItem that is marked as pending
* */
const transactionItemHarness = await loader.getHarness(TransactionItemHarness.with({
transactionPending: true
}));
/*
* No need to verify that the query returned at least one item like above.
* If clickViewTransactionButton() is called but no items are found the test
* will fail.
* */
await transactionItemHarness.clickViewTransactionButton();
expect(component.viewTransaction).not.toHaveBeenCalled();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment