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

Fix download-logs tests

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev 2022-11-28 10:46:55 +03:00
parent 6b2b9bcc0f
commit d598ee5c37
2 changed files with 76 additions and 21 deletions

View File

@ -746,31 +746,35 @@ exports[`download logs options in logs dock tab opening pod logs when logs avail
</div>
</div>
<div
class="LogList flex"
class="LogList"
>
<div
class="VirtualList box grow"
class="virtualizer"
style="height: 38px;"
>
<div>
<div
class="list"
style="position: relative; height: 420000px; width: 100%; overflow: auto; will-change: transform; direction: ltr;"
>
<div
class="anchorLine"
style="top: 0px;"
/>
<div
class="rowWrapper"
style="transform: translateY(0px);"
>
<div>
<div
style="height: 18px; width: 100%;"
class="LogRow"
>
<div
class="LogRow"
style="position: absolute; left: 0px; top: 0px; height: 18px; width: 100%;"
>
<span>
some-logs
</span>
<br />
</div>
<span>
some-logs
</span>
<br />
</div>
</div>
</div>
<div
class="anchorLine"
style="bottom: 0px;"
/>
</div>
</div>
<div
@ -789,6 +793,21 @@ exports[`download logs options in logs dock tab opening pod logs when logs avail
<div
class="flex gaps align-center"
>
<label
class="Checkbox flex align-center wrap-logs"
>
<input
type="checkbox"
/>
<i
class="box flex align-center"
/>
<span
class="label"
>
Wrap logs
</span>
</label>
<label
class="Checkbox flex align-center show-timestamps"
>
@ -1599,11 +1618,21 @@ exports[`download logs options in logs dock tab opening pod logs when logs not a
</div>
</div>
<div
class="LogList flex box grow align-center justify-center"
class="LogList"
>
There are no logs available for container
docker-exporter
<div
class="virtualizer"
style="height: 0px;"
>
<div
class="anchorLine"
style="top: 0px;"
/>
<div
class="anchorLine"
style="bottom: 0px;"
/>
</div>
</div>
<div
class="controls"
@ -1613,6 +1642,21 @@ exports[`download logs options in logs dock tab opening pod logs when logs not a
<div
class="flex gaps align-center"
>
<label
class="Checkbox flex align-center wrap-logs"
>
<input
type="checkbox"
/>
<i
class="box flex align-center"
/>
<span
class="label"
>
Wrap logs
</span>
</label>
<label
class="Checkbox flex align-center show-timestamps"
>

View File

@ -29,6 +29,17 @@ import showErrorNotificationInjectable from "../../renderer/components/notificat
import type { DiContainer } from "@ogre-tools/injectable";
import type { Container } from "../../common/k8s-api/endpoints";
const observe = jest.fn();
Object.defineProperty(window, "IntersectionObserver", {
writable: true,
value: jest.fn().mockImplementation(() => ({
observe,
disconnect: jest.fn(),
unobserve: jest.fn(),
})),
});
describe("download logs options in logs dock tab", () => {
let windowDi: DiContainer;
let rendered: RenderResult;