Skip to content

Commit

Permalink
use toHaveBeenCalledOnce for code button tests
Browse files Browse the repository at this point in the history
  • Loading branch information
iyannsch committed Feb 18, 2025
1 parent 9a2f72f commit 2df48e6
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -487,10 +487,10 @@ describe('CodeButtonComponent', () => {
fixture.detectChanges();

await component.startOnlineIDE();
expect(getToolTokenSpy).toHaveBeenCalled();
expect(windowOpenSpy).toHaveBeenCalledWith('', '_blank');
expect(documentAppendChildSpy).toHaveBeenCalled();
expect(formSubmitSpy).toHaveBeenCalled();
expect(getToolTokenSpy).toHaveBeenCalledOnce();
expect(windowOpenSpy).toHaveBeenCalledExactlyOnceWith('', '_blank');
expect(documentAppendChildSpy).toHaveBeenCalledOnce();
expect(formSubmitSpy).toHaveBeenCalledOnce();

const form = documentAppendChildSpy.mock.calls[0]?.[0] as HTMLFormElement;
if (!form) {
Expand Down

0 comments on commit 2df48e6

Please sign in to comment.