mirror of
https://github.com/Automattic/harper.git
synced 2025-12-23 08:48:15 +00:00
Some checks are pending
Binaries / harper-cli - macOS-aarch64 (push) Waiting to run
Binaries / harper-cli - Linux-aarch64-GNU (push) Waiting to run
Binaries / harper-cli - Linux-aarch64-musl (push) Waiting to run
Binaries / harper-cli - macOS-x86_64 (push) Waiting to run
Binaries / harper-cli - Linux-x86_64-GNU (push) Waiting to run
Binaries / harper-cli - Linux-x86_64-musl (push) Waiting to run
Binaries / harper-cli - Windows-x86_64 (push) Waiting to run
Binaries / harper-ls - macOS-aarch64 (push) Waiting to run
Binaries / harper-ls - Linux-aarch64-GNU (push) Waiting to run
Binaries / harper-ls - Linux-aarch64-musl (push) Waiting to run
Binaries / harper-ls - macOS-x86_64 (push) Waiting to run
Binaries / harper-ls - Linux-x86_64-GNU (push) Waiting to run
Binaries / harper-ls - Linux-x86_64-musl (push) Waiting to run
Binaries / harper-ls - Windows-x86_64 (push) Waiting to run
Build Web / build-web (push) Waiting to run
Chrome Plugin / chrome-plugin (push) Waiting to run
Just Checks / just build-obsidian (push) Waiting to run
Just Checks / just test-harperjs (push) Waiting to run
Just Checks / just test-obsidian (push) Waiting to run
Just Checks / just test-rust (push) Waiting to run
Just Checks / just test-vscode (push) Waiting to run
VS Code Plugin / alpine-arm64 (push) Waiting to run
VS Code Plugin / darwin-arm64 (push) Waiting to run
VS Code Plugin / linux-armhf (push) Waiting to run
VS Code Plugin / linux-x64 (push) Waiting to run
WordPress Plugin / wp-plugin (push) Waiting to run
Just Checks / just check-js (push) Waiting to run
Just Checks / just check-rust (push) Waiting to run
Just Checks / just test-chrome-plugin (push) Waiting to run
Just Checks / just test-firefox-plugin (push) Waiting to run
VS Code Plugin / alpine-x64 (push) Waiting to run
VS Code Plugin / darwin-x64 (push) Waiting to run
VS Code Plugin / linux-arm64 (push) Waiting to run
VS Code Plugin / win32-arm64 (push) Waiting to run
VS Code Plugin / win32-x64 (push) Waiting to run
50 lines
1.3 KiB
TypeScript
50 lines
1.3 KiB
TypeScript
import { test } from './fixtures';
|
|
import {
|
|
assertHarperHighlightBoxes,
|
|
getTextarea,
|
|
replaceEditorContent,
|
|
testBasicSuggestionTextarea,
|
|
testCanIgnoreTextareaSuggestion,
|
|
} from './testUtils';
|
|
|
|
const TEST_PAGE_URL = 'http://localhost:8081/github_textarea.html';
|
|
|
|
testBasicSuggestionTextarea(TEST_PAGE_URL);
|
|
testCanIgnoreTextareaSuggestion(TEST_PAGE_URL);
|
|
|
|
test('Wraps correctly', async ({ page }) => {
|
|
await page.goto(TEST_PAGE_URL);
|
|
|
|
await page.waitForTimeout(2000);
|
|
await page.reload();
|
|
|
|
const editor = getTextarea(page);
|
|
await replaceEditorContent(
|
|
editor,
|
|
'This is a test of the Harper grammar checker, specifically if \nit is wrapped around a line weirdl y',
|
|
);
|
|
|
|
await page.waitForTimeout(6000);
|
|
|
|
await assertHarperHighlightBoxes(page, [
|
|
{ x: 260.234375, y: 103, width: 67.21875, height: 18 },
|
|
{ x: 512.28125, y: 63, width: 25.21875, height: 18 },
|
|
]);
|
|
});
|
|
|
|
test('Scrolls correctly', async ({ page }) => {
|
|
await page.goto(TEST_PAGE_URL);
|
|
|
|
await page.waitForTimeout(2000);
|
|
await page.reload();
|
|
|
|
const editor = getTextarea(page);
|
|
await replaceEditorContent(
|
|
editor,
|
|
'This is a test of the the Harper grammar checker, specifically if \n\n\n\n\n\n\n\n\n\n\n\n\nit scrolls beyo nd the height of the buffer.',
|
|
);
|
|
|
|
await page.waitForTimeout(6000);
|
|
|
|
await assertHarperHighlightBoxes(page, [{ width: 58.828125, x: 117.40625, y: 161, height: 18 }]);
|
|
});
|