File size: 520 Bytes
b59aa07
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import { screen, within } from "@testing-library/react";
import { UserEvent } from "@testing-library/user-event";

export const clickOnEditButton = async (
  user: UserEvent,
  container?: HTMLElement,
) => {
  const wrapper = container ? within(container) : screen;

  const ellipsisButton = wrapper.getByTestId("ellipsis-button");
  await user.click(ellipsisButton);

  const menu = wrapper.getByTestId("context-menu");
  const editButton = within(menu).getByTestId("edit-button");

  await user.click(editButton);
};