Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Add accessibility coverage for PackageSizeIncreaseAnalysis

未关闭
#3,078 0 条评论 1 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 1 天内回复

@userquin 已经在做这个了。

开始于 2026年7月25日。

  • #3077 来自 @userquin —— 已关闭,未合并

评估

这个 Issue 还没有评估数据。

描述

a11y

Summary

Add automated Vitest accessibility coverage for PackageSizeIncreaseAnalysis and remove its temporary exclusion from the component-coverage guard.

The component currently depends on the worker-backed useAnalyzeCauseWorker composable, so the test must isolate the UI from real Web Worker and IndexedDB behaviour.

Required changes

  • Add an accessibility/component test for app/components/Package/SizeIncreaseAnalysis.vue.
  • Mock useAnalyzeCauseWorker (and the worker boundary if the established test setup requires it) with reactive, type-safe state and no-op actions.
  • Cover the initial available state and assert that axe reports no accessibility violations.
  • Remove the Package/SizeIncreaseAnalysis.vue TODO/entry from SKIPPED_COMPONENTS in test/unit/a11y-component-coverage.spec.ts.

Rationale

The current skip leaves the new package-size analysis UI outside the repository’s required component accessibility coverage. A deterministic mock prevents browser-worker and IndexedDB dependencies from making the test brittle.

Affected areas

  • app/components/Package/SizeIncreaseAnalysis.vue
  • app/composables/pkg-size/useAnalyzeCauseWorker.ts
  • test/nuxt/a11y.spec.ts (or the established component-test location)
  • test/unit/a11y-component-coverage.spec.ts

Acceptance criteria

  • A Vitest test mounts PackageSizeIncreaseAnalysis with a mocked analysis composable.
  • The test performs an axe accessibility assertion without starting a real worker.
  • The temporary coverage skip and its TODO are removed.
  • The relevant test suite passes.

Requested by @userquin.

Backlinks: https://github.com/npmx-dev/npmx.dev/pull/3077 and https://github.com/npmx-dev/npmx.dev/pull/3077#discussion_r3649237902

主要语言
TypeScript
星标
3.6k
派生
533
平均合并
4 天 1 小时
30 天内合并 PR
39

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

npmx-dev/npmx.dev 的其他 Issue

查看 npmx-dev/npmx.dev 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。