Skip to content

Commit

Permalink
test: follow mike request - replace data-testid for querySelector by …
Browse files Browse the repository at this point in the history
…classes on file ProjeCard.jsx
  • Loading branch information
wrspada02 committed Sep 30, 2024
1 parent c9bddce commit 69e6613
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion app/assets/javascripts/components/projects/ProjectCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ export default class ProjectCard extends React.Component {
<ul
className="dropdown-menu dropdown-menu-right"
aria-labelledby="dLabel"
data-testid="dropdown-menu-container"
>
<li className="dropdown-header">{I18n.t('options')}</li>

Expand Down
8 changes: 4 additions & 4 deletions spec/javascripts/components/projects/project_card_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ describe('<ProjectCard />', () => {

describe('.dropdown-menu', () => {
it('should contain dropdown-menu', () => {
const { getByTestId } = render(<ProjectCard {...defaultProps} />);
const { container } = render(<ProjectCard {...defaultProps} />);

expect(getByTestId('dropdown-menu-container')).toHaveClass(
expect(container.querySelector('.dropdown-menu')).toHaveClass(
'dropdown-menu'
);
});
Expand Down Expand Up @@ -186,10 +186,10 @@ describe('<ProjectCard />', () => {
describe('.dropdown-menu', () => {
it('should not contain dropdown-menu', () => {
defaultProps.joined = false;
const { queryByTestId } = render(<ProjectCard {...defaultProps} />);
const { container } = render(<ProjectCard {...defaultProps} />);

expect(
queryByTestId('dropdown-menu-container')
container.querySelector('.dropdown-menu')
).not.toBeInTheDocument();
});
});
Expand Down

0 comments on commit 69e6613

Please sign in to comment.