Using asElement() for assertions

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

No files matched your search

+6 -10
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,
);