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

Testing bounding boxes

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev 2022-12-02 13:56:22 +03:00
parent 4fbaa7f43f
commit 59d07907ee

View File

@ -136,7 +136,7 @@ describeIf(minikubeReady(TEST_NAMESPACE))("Minikube based tests", () => {
10 * 60 * 1000,
);
it(
it.only(
"should create a pod with logs and wrap log lines",
async () => {
await navigateToPods(frame);
@ -189,16 +189,18 @@ describeIf(minikubeReady(TEST_NAMESPACE))("Minikube based tests", () => {
await frame.waitForSelector(".Dock.isOpen");
const logLine = await frame.waitForSelector("[data-testid=pod-log-list] [data-index='0']");
// @ts-ignore
const lineContents = logLine.getByText("text");
const lineBoundingBox = await logLine.boundingBox();
expect(lineContents).toHaveStyle({ "white-space": "nowrap" });
expect(lineBoundingBox?.height).toBeLessThan(20);
expect(lineBoundingBox?.width).toBeLessThan(30);
await frame.click("[data-testid='log-controls'] .wrap-logs");
await frame.waitForTimeout(3000);
const wrappedLogLine = await frame.waitForSelector("[data-testid=pod-log-list] [data-index='0']");
const wrappedLineBoundingBox = await wrappedLogLine.boundingBox();
expect(wrappedLogLine.asElement()).toHaveStyle({ "white-space": "normal" });
expect(wrappedLineBoundingBox?.height).toBeGreaterThan(30);
expect(wrappedLineBoundingBox?.width).toBeLessThan(30);
},
10 * 60 * 1000,
);