mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
try and fix test again
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
parent
4fafcc19b6
commit
fc57049b8f
@ -170,7 +170,7 @@ describe("kube-object-menu", () => {
|
||||
|
||||
it("renders", async () => {
|
||||
await screen.findByTestId("confirmation-dialog");
|
||||
expect(baseElement).toMatchSnapshot();
|
||||
await waitFor(() => expect(baseElement).toMatchSnapshot());
|
||||
});
|
||||
|
||||
describe("when remove is confirmed", () => {
|
||||
|
||||
@ -134,17 +134,23 @@ class NonInjectedKubeObjectMenu<Kube extends KubeObject> extends React.Component
|
||||
private renderContextMenuItems = (object: KubeObject) => (
|
||||
[...this.menuItems]
|
||||
.reverse() // This is done because the order that we "grow" is right->left
|
||||
.map(({ icon, ...rest }) => ({
|
||||
...rest,
|
||||
icon: typeof icon === "string"
|
||||
? { material: icon }
|
||||
: icon,
|
||||
}))
|
||||
.map((item, index) => (
|
||||
<MenuItem
|
||||
key={`context-menu-item-${index}`}
|
||||
onClick={() => item.onClick(object)}
|
||||
data-testid={`menu-action-${item.title.toLowerCase().replace(/\s+/, "-")}`}
|
||||
>
|
||||
{
|
||||
typeof item.icon === "string"
|
||||
? <Icon material={item.icon} interactive={this.props.toolbar} tooltip={item.title} />
|
||||
: <Icon {...item.icon} interactive={this.props.toolbar} tooltip={item.title} />
|
||||
}
|
||||
<Icon
|
||||
{...item.icon}
|
||||
interactive={this.props.toolbar}
|
||||
tooltip={item.title}
|
||||
/>
|
||||
<span className="title">
|
||||
{item.title}
|
||||
</span>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user