test: tag rtl_url_param toggle-off specs with @feature:rtl-toggle (#7661)

* test: tag rtl_url_param toggle-off specs with @feature:rtl-toggle

The two cases that require RTL to be flippable away from the
plugin-forced default — `?rtl=false` overriding a prior `?rtl=true`
and a no-param reload falling back to the cookie — are exactly what
ep_right_to_left intentionally disables. Tag them so the plugin can
declare `disables: ["@feature:rtl-toggle"]` and pass the disables
contract's honesty check.

Also list the new tag (and the previously omitted @feature:line-numbers)
in doc/PLUGIN_FEATURE_DISABLES.md.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* test: also tag chat title-bar layout spec with @feature:rtl-toggle

The leftGap/rightGap symmetry assertion in this test is LTR-only:
colibris ships a one-sided #titlebar padding rule (the existing
asymmetric pad is fine in LTR because the buttons are on the right
where the larger pad sits) that throws gaps apart by ~170px when
body[dir=rtl] reverses the flex item order.

Without a fix to colibris's chat header padding (out of scope here),
plugins that force RTL on can't pass this assertion. Add the second
tag so they can declare the disable instead of false-failing it.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
John McLear 2026-05-03 13:26:50 +08:00 committed by GitHub
parent 0803791acc
commit aee2b79b6a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 10 additions and 3 deletions

View File

@ -26,6 +26,8 @@ Tags currently in use:
- `@feature:username`
- `@feature:clear-authorship`
- `@feature:error-gritter`
- `@feature:line-numbers`
- `@feature:rtl-toggle`
### 2. A plugin declares the features it disables in its `ep.json`

View File

@ -150,7 +150,12 @@ test('chat icon click reveals chatbox after a disable → enable cycle', {
// Title-bar layout / glyph regressions from #7590 review.
test('chat title bar lays out as a centred flex row with underscore minimize', {
tag: '@feature:chat',
// `@feature:rtl-toggle` because the symmetric leftGap/rightGap
// assertion is only valid in LTR — the colibris #titlebar padding
// rule ships a one-sided pad that flips under `body[dir=rtl]`,
// throwing the gap apart by ~170px. A plugin that forces RTL on
// (e.g. ep_right_to_left) declares this in its disables list.
tag: ['@feature:chat', '@feature:rtl-toggle'],
}, async ({page}) => {
await showChat(page);

View File

@ -13,7 +13,7 @@ test.describe('RTL URL parameter', function () {
await expect(page.locator('#options-rtlcheck')).toBeChecked();
});
test('rtl=false disables RTL mode after rtl=true', async function ({page}) {
test('rtl=false disables RTL mode after rtl=true', {tag: '@feature:rtl-toggle'}, async function ({page}) {
// First enable RTL via URL
await appendQueryParams(page, {rtl: 'true'});
await expect(page.locator('#options-rtlcheck')).toBeChecked();
@ -23,7 +23,7 @@ test.describe('RTL URL parameter', function () {
await expect(page.locator('#options-rtlcheck')).not.toBeChecked();
});
test('no rtl param falls back to the pad setting after an RTL URL override', async function ({page}) {
test('no rtl param falls back to the pad setting after an RTL URL override', {tag: '@feature:rtl-toggle'}, async function ({page}) {
// Enable RTL via URL for the current page load only
await appendQueryParams(page, {rtl: 'true'});
await expect(page.locator('#options-rtlcheck')).toBeChecked();