bismuth/test/test_surface.ts
Mikhail Zolotukhin caa1d25858 feat: add jest as unit testing framework
arstarst
2021-09-04 22:38:48 +03:00

34 lines
824 B
TypeScript

// SPDX-FileCopyrightText: 2018-2019 Eon S. Jeon <esjeon@hyunmu.am>
// SPDX-FileCopyrightText: 2021 Mikhail Zolotukhin <mail@genda.life>
//
// SPDX-License-Identifier: MIT
import ISurface from "../src/isurface";
import Rect from "../src/util/rect";
import TestDriver from "./test_driver";
export default class TestSurface implements ISurface {
public readonly screen: number;
public get id(): string {
return String(this.screen);
}
public get ignore(): boolean {
// TODO: optionally ignore some surface to test LayoutStore
return false;
}
public get workingArea(): Rect {
return this.driver.screenSize;
}
constructor(private driver: TestDriver, screen: number) {
this.screen = screen;
}
public next(): ISurface {
return new TestSurface(this.driver, this.screen + 1);
}
}