1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Using asElement() for assertions

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev 2022-12-02 12:49:17 +03:00
parent 5921098bde
commit 8566ae8e9e
2 changed files with 6 additions and 11 deletions

View File

@ -188,19 +188,15 @@ describeIf(minikubeReady(TEST_NAMESPACE))("Minikube based tests", () => {
await frame.click(".MenuItem >> text=Logs");
await frame.waitForSelector(".Dock.isOpen");
const logLine = await frame.getByTestId("log-row-0");
expect(logLine).toHaveStyle({
"white-space": "nowrap",
});
const logLine = await frame.waitForSelector("[data-testid=pod-log-list] [data-index='0']");
expect(logLine.asElement()).toHaveStyle({ "white-space": "nowrap" });
await frame.click("[data-testid='log-controls'] .wrap-logs");
const wrappedLogLine = await frame.getByTestId("log-row-0");
expect(wrappedLogLine).toHaveStyle({
"white-space": "normal",
});
const wrappedLogLine = await frame.waitForSelector("[data-testid=pod-log-list] [data-index='0']");
expect(wrappedLogLine.asElement()).toHaveStyle({ "white-space": "normal" });
},
10 * 60 * 1000,
);

View File

@ -80,7 +80,6 @@ export const LogList = observer(({ model }: LogListProps) => {
<div
key={virtualRow.index + uniqRowKey}
data-index={virtualRow.index}
data-testid={`log-row-${virtualRow.index}`}
ref={rowVirtualizer.measureElement}
style={{
transform: `translateY(${virtualRow.start}px)`,