Skip to content

test: add @feature:authorship-bg-color tag for plugins that re-render authorship#7657

Merged
JohnMcLear merged 1 commit intodevelopfrom
test/tag-authorship-bg-color
May 2, 2026
Merged

test: add @feature:authorship-bg-color tag for plugins that re-render authorship#7657
JohnMcLear merged 1 commit intodevelopfrom
test/tag-authorship-bg-color

Conversation

@JohnMcLear
Copy link
Copy Markdown
Member

Follow-up to #7648 / #7655 — extends the disables contract to cover plugins that swap Etherpad's coloured-background authorship indicator for something else (ep_author_neat2 uses underlines).

Why

change_user_color.spec.ts:59 hard-asserts:

const color = await chatP.evaluate((el) =>
  window.getComputedStyle(el).getPropertyValue('background-color'));
expect(color).toBe(testColorRGB);

That assertion is correct for stock Etherpad but legitimately false under any plugin that swaps the colour-block rendering (per ep_author_neat2's README: "uses colored underlines instead of colored backgrounds to indicate authorship"). Without a tag, those plugins can't pass the disables-aware test runner.

Change

Adds a second tag alongside the existing @feature:chat:

tag: ['@feature:chat', '@feature:authorship-bg-color'],

ep_author_neat2 will declare "disables": ["@feature:authorship-bg-color"] in its ep.json. ep_disable_chat continues to exclude it via the existing @feature:chat tag (multi-tag tests are excluded if any of their tags match --grep-invert).

Verified locally: playwright test --list --grep '@feature:authorship-bg-color' returns exactly the one test.

🤖 Generated with Claude Code

… authorship

Plugins like ep_author_neat2 swap Etherpad's coloured-background
authorship indicator for an underline. Their README is explicit
about this; their main is red on the disables-aware test runner
because change_user_color.spec.ts:59 hard-asserts the chat <p>'s
background-color matches the user's colour, which a non-background
rendering legitimately won't satisfy.

Add a second tag (@feature:authorship-bg-color) alongside the
existing @feature:chat so plugins that swap rendering can declare
"disables": ["@feature:authorship-bg-color"] and have this single
spec excluded from pass-1 regression while still running pass-2
honesty (the bg-color assertion fails under the plugin → contract
honoured).

Multi-tag: ep_disable_chat keeps excluding it via @feature:chat;
ep_author_neat2 excludes it via @feature:authorship-bg-color.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@qodo-code-review
Copy link
Copy Markdown

ⓘ You've reached your Qodo monthly free-tier limit. Reviews pause until next month — upgrade your plan to continue now, or link your paid account if you already have one.

@qodo-free-for-open-source-projects
Copy link
Copy Markdown

Review Summary by Qodo

Add authorship background color feature tag for plugin compatibility

🧪 Tests

Grey Divider

Walkthroughs

Description
• Add @feature:authorship-bg-color tag to chat color test
• Allow plugins that re-render authorship to disable specific assertion
• Support alternative authorship rendering (e.g., underlines instead of backgrounds)
• Enable multi-tag filtering for disables-aware test runner
Diagram
flowchart LR
  A["change_user_color.spec.ts"] -->|adds tag| B["@feature:authorship-bg-color"]
  B -->|allows plugins to declare| C["disables in ep.json"]
  C -->|excludes test from| D["pass-1 regression run"]
  D -->|while allowing| E["pass-2 honesty test"]
Loading

Grey Divider

File Changes

1. src/tests/frontend-new/specs/change_user_color.spec.ts 🧪 Tests +7/-1

Add multi-tag support for authorship rendering variants

• Changed test tag from single string to array with two tags: @feature:chat and
 @feature:authorship-bg-color
• Added detailed comment explaining why the new tag is needed for plugins that swap background-based
 authorship rendering
• Clarifies that plugins like ep_author_neat2 can now declare the tag in their disables list to
 exclude this test

src/tests/frontend-new/specs/change_user_color.spec.ts


Grey Divider

Qodo Logo

@qodo-free-for-open-source-projects
Copy link
Copy Markdown

qodo-free-for-open-source-projects Bot commented May 2, 2026

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (0)

Grey Divider


Remediation recommended

1. Docs missing new tag 🐞 Bug ⚙ Maintainability
Description
A new feature tag (@feature:authorship-bg-color) is introduced in a core spec but the documented
“Tags currently in use” list is not updated, making the disables contract harder for plugin authors
to discover and follow. This contradicts the documented process that says to update that list when
adding a new feature tag.
Code

src/tests/frontend-new/specs/change_user_color.spec.ts[R60-66]

+    // Asserts the user's colour appears as the chat <p> background. Plugins
+    // that re-render authorship as something other than a background (e.g.
+    // ep_author_neat2 swaps the colour-block for an underline) legitimately
+    // make this assertion stop holding, so they declare
+    // `@feature:authorship-bg-color` in their ep.json `disables` list and
+    // the test is excluded from their pass-1 regression run.
+    tag: ['@feature:chat', '@feature:authorship-bg-color'],
Evidence
The PR adds the new tag to a Playwright test. The disables contract documentation contains an
explicit list of tags currently in use and an explicit instruction to update that list when
introducing a new tag; the list shown in the doc does not include @feature:authorship-bg-color.

src/tests/frontend-new/specs/change_user_color.spec.ts[59-67]
doc/PLUGIN_FEATURE_DISABLES.md[23-29]
doc/PLUGIN_FEATURE_DISABLES.md[74-82]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
A new Playwright feature tag (`@feature:authorship-bg-color`) was added to a core frontend spec, but the central documentation list of feature tags was not updated.

### Issue Context
`doc/PLUGIN_FEATURE_DISABLES.md` is the contract reference for plugin authors and explicitly instructs updating the “Tags currently in use” list when new tags are introduced.

### Fix Focus Areas
- doc/PLUGIN_FEATURE_DISABLES.md[23-29]
- doc/PLUGIN_FEATURE_DISABLES.md[74-82]

### Proposed change
Add `@feature:authorship-bg-color` to the “Tags currently in use” bullet list (and keep the list alphabetized if that’s the convention).

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Qodo Logo

@JohnMcLear JohnMcLear merged commit 0be8afc into develop May 2, 2026
42 checks passed
@JohnMcLear JohnMcLear deleted the test/tag-authorship-bg-color branch May 2, 2026 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant