mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-08-13 20:35:56 +08:00
feat: update tests
This commit is contained in:
parent
b499b10333
commit
1b8213653a
@ -521,65 +521,64 @@ function DashboardsList(): JSX.Element {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{action && (
|
{action && (
|
||||||
<div data-testid="dashboard-action-popover">
|
<Popover
|
||||||
<Popover
|
trigger="click"
|
||||||
trigger="click"
|
content={
|
||||||
content={
|
<div className="dashboard-action-content">
|
||||||
<div className="dashboard-action-content">
|
<section className="section-1">
|
||||||
<section className="section-1">
|
<Button
|
||||||
<Button
|
type="text"
|
||||||
type="text"
|
className="action-btn"
|
||||||
className="action-btn"
|
icon={<Expand size={12} />}
|
||||||
icon={<Expand size={12} />}
|
onClick={onClickHandler}
|
||||||
onClick={onClickHandler}
|
>
|
||||||
>
|
View
|
||||||
View
|
</Button>
|
||||||
</Button>
|
<Button
|
||||||
<Button
|
type="text"
|
||||||
type="text"
|
className="action-btn"
|
||||||
className="action-btn"
|
icon={<Link2 size={12} />}
|
||||||
icon={<Link2 size={12} />}
|
onClick={(e): void => {
|
||||||
onClick={(e): void => {
|
e.stopPropagation();
|
||||||
e.stopPropagation();
|
e.preventDefault();
|
||||||
e.preventDefault();
|
setCopy(`${window.location.origin}${getLink()}`);
|
||||||
setCopy(`${window.location.origin}${getLink()}`);
|
}}
|
||||||
}}
|
>
|
||||||
>
|
Copy Link
|
||||||
Copy Link
|
</Button>
|
||||||
</Button>
|
<Button
|
||||||
<Button
|
type="text"
|
||||||
type="text"
|
className="action-btn"
|
||||||
className="action-btn"
|
icon={<FileJson size={12} />}
|
||||||
icon={<FileJson size={12} />}
|
onClick={handleJsonExport}
|
||||||
onClick={handleJsonExport}
|
>
|
||||||
>
|
Export JSON
|
||||||
Export JSON
|
</Button>
|
||||||
</Button>
|
</section>
|
||||||
</section>
|
<section className="section-2">
|
||||||
<section className="section-2">
|
<DeleteButton
|
||||||
<DeleteButton
|
name={dashboard.name}
|
||||||
name={dashboard.name}
|
id={dashboard.id}
|
||||||
id={dashboard.id}
|
isLocked={dashboard.isLocked}
|
||||||
isLocked={dashboard.isLocked}
|
createdBy={dashboard.createdBy}
|
||||||
createdBy={dashboard.createdBy}
|
/>
|
||||||
/>
|
</section>
|
||||||
</section>
|
</div>
|
||||||
</div>
|
}
|
||||||
}
|
placement="bottomRight"
|
||||||
placement="bottomRight"
|
arrow={false}
|
||||||
arrow={false}
|
rootClassName="dashboard-actions"
|
||||||
rootClassName="dashboard-actions"
|
>
|
||||||
>
|
<EllipsisVertical
|
||||||
<EllipsisVertical
|
className="dashboard-action-icon"
|
||||||
className="dashboard-action-icon"
|
size={14}
|
||||||
size={14}
|
data-testid="dashboard-action-icon"
|
||||||
onClick={(e): void => {
|
onClick={(e): void => {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Popover>
|
</Popover>
|
||||||
</div>
|
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className="dashboard-details">
|
<div className="dashboard-details">
|
||||||
|
@ -218,7 +218,7 @@ describe('dashboard list page', () => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
await waitFor(() => {
|
await waitFor(() => {
|
||||||
const popovers = getAllByTestId('dashboard-action-popover');
|
const popovers = getAllByTestId('dashboard-action-icon');
|
||||||
expect(popovers).toHaveLength(dashboardSuccessResponse.data.length);
|
expect(popovers).toHaveLength(dashboardSuccessResponse.data.length);
|
||||||
fireEvent.click([...popovers[0].children][0]);
|
fireEvent.click([...popovers[0].children][0]);
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user