mirror of
https://github.com/Ku6epXBOCTuK/easy-png-tools.git
synced 2026-11-13 17:08:20 +00:00
chore: clear lint rules warns: comments, tests
This commit is contained in:
@@ -59,7 +59,7 @@ function findChunk(png: Buffer, type: string): number {
|
||||
throw new Error(`PNG chunk ${type} not found`);
|
||||
}
|
||||
|
||||
/** Строит валидный RGBA PNG в рантайме (8-bit, фильтр type 0, deflate/zlib). */
|
||||
/** Builds a valid RGBA PNG at runtime (8-bit, filter type 0, deflate/zlib). */
|
||||
export function makePng(
|
||||
width: number,
|
||||
height: number,
|
||||
@@ -279,7 +279,7 @@ export const svgMarkup =
|
||||
const PIXEL_BYTES = (r: number, g: number, b: number, a: number): string =>
|
||||
`${r} ${g} ${b} ${a}`;
|
||||
|
||||
/** Строка для bytes-to-png / rgb-values-to-png, ровно 32 пикселя в ширину по умолчанию. */
|
||||
/** Input row for bytes-to-png / rgb-values-to-png, 32 pixels per line by default. */
|
||||
export function pixelRow(
|
||||
count: number,
|
||||
rgba: [number, number, number, number],
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
import { ru } from "../../src/lib/i18n/ru";
|
||||
|
||||
/** RU page title from the dictionary; RU text is never hardcoded in specs. */
|
||||
export function ruPageTitle(slug: string): string {
|
||||
const title = ru.pages?.[slug]?.title;
|
||||
if (!title) throw new Error(`ru dictionary has no pages.${slug}.title`);
|
||||
return title;
|
||||
}
|
||||
@@ -76,8 +76,8 @@ export async function renderText(page: Page, value: string): Promise<void> {
|
||||
}
|
||||
|
||||
export async function uploadImage(page: Page, file: SourceFile): Promise<void> {
|
||||
// На странице может быть два input[type=file]: дропзона + кнопка Open image;
|
||||
// канонический — первый (кнопка в шапке панели).
|
||||
// The page can have two input[type=file]: dropzone + Open image button;
|
||||
// the canonical one is the first (the button in the panel header).
|
||||
const input = page.locator('input[type="file"]').first();
|
||||
await expect(input).toBeAttached();
|
||||
await input.setInputFiles({
|
||||
@@ -117,7 +117,7 @@ export async function uploadViaDrop(
|
||||
}
|
||||
|
||||
export async function downloadResultFile(page: Page): Promise<Download> {
|
||||
// Split-кнопка: основная часть "Download" (image) или "Download ZIP" (files).
|
||||
// Split button: the main part is "Download" (image) or "Download ZIP" (files).
|
||||
const button = page.getByRole("button", { name: /^Download( ZIP)?$/ });
|
||||
await expect(button).toBeVisible();
|
||||
const [download] = await Promise.all([
|
||||
@@ -156,5 +156,5 @@ export async function expectNoErrorAlert(page: Page): Promise<void> {
|
||||
}
|
||||
|
||||
export async function expectNoErrors(sink: ErrorSink): Promise<void> {
|
||||
expect(sink.errors, "нет console/page errors").toEqual([]);
|
||||
expect(sink.errors, "no console/page errors").toEqual([]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user