Skip to content

Commit

Permalink
test: check for button text instead of function argument
Browse files Browse the repository at this point in the history
  • Loading branch information
erikian committed Jan 17, 2024
1 parent b161aa5 commit 708e7fa
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions rtl-spec/components/commands-version-chooser.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';

import { render, screen } from '@testing-library/react';
import { render, screen, waitFor } from '@testing-library/react';
import userEvent from '@testing-library/user-event';

import { VersionChooser } from '../../src/renderer/components/commands-version-chooser';
Expand Down Expand Up @@ -28,6 +28,10 @@ describe('VersionSelect component', () => {

await userEvent.click(versionButton);

expect(appState.setVersion).toHaveBeenCalledWith(mockVersion1.version);
waitFor(() =>
expect(btnOpenVersionSelector.textContent).toContain(
mockVersion1.version,
),
);
});
});

0 comments on commit 708e7fa

Please sign in to comment.