-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
51 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// For vite env. | ||
export const isNode = typeof navigator === "undefined" ? true : false; | ||
|
||
const userAgent = isNode ? "node" : navigator.userAgent; | ||
|
||
export const isFireFox = userAgent.includes("Firefox"); | ||
|
||
export const isLegacyEdge = userAgent.includes("Edge"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { describe, beforeAll, test, expect } from "vitest"; | ||
import { createBrowser, createPage, openTerminal, app } from "./utils"; | ||
|
||
describe("textBaseline in Chromium", () => { | ||
let browser; | ||
let page; | ||
|
||
beforeAll(async () => { | ||
browser = await createBrowser(); | ||
page = await createPage(browser); | ||
await page.goto(app("noop")); | ||
}); | ||
|
||
test("textBaseline should be ideographic in Chromium.", async () => { | ||
await openTerminal(page); | ||
await page.evaluate("window.terminal.char('@', 0, 0, 'red', 'red')"); | ||
expect(await page.evaluate("window.terminal._context.textBaseline")).toBe("ideographic"); | ||
}); | ||
}); | ||
|
||
describe("textBaseline in FireFox", () => { | ||
let browser; | ||
let page; | ||
|
||
beforeAll(async () => { | ||
browser = await createBrowser({ type: "firefox" }); | ||
page = await createPage(browser); | ||
await page.goto(app("noop")); | ||
}); | ||
|
||
test("textBaseline should be bottom in Firefox.", async () => { | ||
await openTerminal(page); | ||
await page.evaluate("window.terminal.char('@', 0, 0, 'red', 'red')"); | ||
expect(await page.evaluate("window.terminal._context.textBaseline")).toBe("bottom"); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters