Skip to content

test(core): add ascii-map unit tests#1707

Open
Harshithk951 wants to merge 1 commit into
Karanjot786:mainfrom
Harshithk951:test-ascii-map
Open

test(core): add ascii-map unit tests#1707
Harshithk951 wants to merge 1 commit into
Karanjot786:mainfrom
Harshithk951:test-ascii-map

Conversation

@Harshithk951

@Harshithk951 Harshithk951 commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Description

This PR adds comprehensive unit tests for packages/core/src/terminal/ascii-map.ts to verify its functional correctness and prevent regressions.

Changes

  • Added ascii-map.test.ts to verify the behavior of the BOX, BRAILLE_SPIN, and BLOCK character definitions:
    • BOX mapping: Verifies that standard box drawing characters correctly map to ascii equivalents.
    • BLOCK progress representation: Verifies block progress element representations.
    • BRAILLE_SPIN frames: Verifies the spinner animation characters are defined correctly.

Related Issue

Closes #1705

Summary by CodeRabbit

  • Tests
    • Added test coverage for terminal ASCII character fallback behavior, including box-drawing character mappings, animation frame sequences, and progress bar indicators.

@github-actions github-actions Bot added type:testing +10 pts. Tests. area:core @termuijs/core labels Jun 21, 2026
@coderabbitai

coderabbitai Bot commented Jun 21, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 02188c80-22a4-4e05-be89-a03e611b76b6

📥 Commits

Reviewing files that changed from the base of the PR and between 35c2213 and eff0533.

📒 Files selected for processing (1)
  • packages/core/src/terminal/ascii-map.test.ts

📝 Walkthrough

Walkthrough

A new Vitest test file ascii-map.test.ts is added to packages/core/src/terminal/. It contains a test suite that asserts the ASCII fallback values for BOX box-drawing characters, the BRAILLE_SPIN frame array, and the BLOCK progress bar character set (full, empty, partial).

Changes

ascii-map terminal fallback test coverage

Layer / File(s) Summary
BOX, BRAILLE_SPIN, and BLOCK fallback assertions
packages/core/src/terminal/ascii-map.test.ts
Adds 26-line Vitest suite verifying exact ASCII fallback characters for BOX corner/junction/line entries, the BRAILLE_SPIN frame sequence, and BLOCK's full, empty, and partial values.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • Karanjot786/TermUI#1159: Adds Vitest coverage for the underlying braille and block symbol constants that ascii-map fallback values are derived from.
  • Karanjot786/TermUI#1548: Adds regression coverage for Unicode-to-ASCII box-drawing fallback rendering in ThinkingBlock, closely related to the BOX fallbacks asserted here.

Suggested labels

quality:clean, type:testing, area:core, level:beginner

Suggested reviewers

  • Karanjot786

Poem

🐇 Hippity-hop through the terminal halls,
Where boxes and spinners line up on the walls.
Each fallback character, neatly in place,
ASCII art dancing with elegant grace.
Tests pass with a wiggle, a binky, a thump —
No braille left untested, no block left a stump! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: adding unit tests for the ascii-map module.
Description check ✅ Passed The description includes required sections (Description, Changes, Related Issue) and clearly explains the test additions, but is missing the PR template's Type of Change checkboxes and other metadata sections.
Linked Issues check ✅ Passed The PR successfully implements all three coding objectives from issue #1705: verifying BOX character fallbacks, BLOCK progress representations, and BRAILLE_SPIN frame definitions.
Out of Scope Changes check ✅ Passed The changes are entirely in-scope, adding only a single test file to verify the ascii-map module without any unrelated modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:core @termuijs/core type:testing +10 pts. Tests.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] Unit Tests for ascii-map in packages/core/src/terminal/ascii-map.ts

1 participant