LearnNewsExamplesServices
Frontmatter
id19504
titleAdd a unit test for the Label component
stateClosed
labels
help wantedgood first issuecontributor-experiencehacktoberfestaitestingcore
assigneesnightcityblade
createdAtOct 9, 2026, 4:52 PM
updatedAtOct 9, 2026, 6:18 PM
githubUrlhttps://github.com/neomjs/neo/issues/19504
authorneo-opus-ada
commentsCount2
parentIssue18985
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined1
signals[]
blockedBy[]
blocking[]
closedAtOct 9, 2026, 6:18 PM

Add a unit test for the Label component

Closed v13.2.0/archive-v13-2-0-chunk-24 help wantedgood first issuecontributor-experiencehacktoberfestaitestingcore
neo-opus-ada
neo-opus-ada commented on Oct 9, 2026, 4:52 PM

What to build

A unit test for Neo.component.Label, the component that renders a <label> element with text. No test covers it today. This is a good first contribution: the component is 30 lines, and a 40-line sibling test shows the exact setup.

Files

  • Create: test/playwright/unit/component/Label.spec.mjs
  • Read: src/component/Label.mjs. It sets ntype: 'label', baseCls: ['neo-label'] and tag: 'label', and inherits everything else from src/component/Base.mjs.
  • Copy the setup from: test/playwright/unit/component/Progress.spec.mjs (40 lines). It has the same imports and setup() call, and creates one component per test.

What the test should check

  1. A created Label renders a label element: label.vdom.tag is 'label'.
  2. Its root carries the neo-label class, and a custom cls (for example ['my-label']) is added next to it, not instead of it.
  3. The text config reaches the rendered vdom. Component.afterSetText() writes it to the vdom root's text key, so label.vdom.text equals the configured text, and changing label.text later updates it.
  4. Creating it by its ntype works: Neo.create({module: Label, ...}) and ntype: 'label' both yield a Neo.component.Label (label.className).
  5. Every test destroys the component it created (label.destroy()), as the sibling does.

How to run

npm install
npm run test-unit -- test/playwright/unit/component/Label.spec.mjs

No Agent OS, MCP server or other service is needed. A plain clone and Node.js are enough.

Done when

  • The new spec passes with the command above.
  • Each check fails when you break the line it covers. Try it once: change tag: 'label' to 'span' in src/component/Label.mjs, see the test go red, then revert.
  • One pull request, with Resolves #<this issue> in its description.

Background

This replaces #7737 (2025), whose plan targeted an older test tier and the "Empty Viewport" setup. @Alachi24 asked for #7737 last year. You're welcome to take this one first: just comment here.

Part of the Hacktoberfest contributor door, #18985. This issue is for first-time contributors: maintainers will not claim or implement it, only review the pull request.

unowned-rationale: open for an outside contributor (#18985's door); a maintainer reviews the PR.

Live latest-open sweep: the latest 20 open issues at 2026-10-09 14:51Z; no Label test issue besides #7737, which this replaces. MC sweep: "Neo.component.Label unit test good first issue Hacktoberfest door", 4 results, no prior decision; the shape follows the 2026-07 good-first-issue precedent (#15117, #15118).

nightcityblade
nightcityblade Oct 9, 2026, 5:08 PM

Hi, I'd like to work on this. I'll submit a PR shortly.

@github-actions - 2026-10-09T15:09:03Z

Thanks for claiming this, @nightcityblade, and welcome! You're first in line, so you can start now.

A maintainer confirms the assignment when one is online, and that can take a while. You don't need to wait for it.

An automatic reply. A maintainer follows up. How claims work [QUARANTINED_URL: github.com]

nightcityblade cross-referenced by PR #19512 on Oct 9, 2026, 6:01 PM