Skip to content

Conversation

@gocanto
Copy link
Contributor

@gocanto gocanto commented Oct 3, 2025

Summary

  • add Vitest coverage for the skeleton partial components to verify animation toggles and structural placeholders
  • assert the post page skeleton exposes a stable test identifier

Testing

  • npm test (fails: vitest binary not available in execution environment)

https://chatgpt.com/codex/tasks/task_e_68df7c594b988333a027318dff37dbf1

Summary by CodeRabbit

  • Tests
    • Expanded test coverage for skeleton UI components, validating default loading animations, the ability to disable animations, and non-interactive/accessibility semantics.
    • Verified correct rendering of placeholder elements and class handling (including custom class merging).
    • Ensures consistent visual behavior and accessibility of loading states across the app.
    • No user-facing changes; improves reliability and confidence in existing behavior.

@coderabbitai
Copy link

coderabbitai bot commented Oct 3, 2025

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Adds five new unit test files under tests/partials for skeleton Vue components, verifying presence of root elements, animate-pulse class defaults, aria-hidden semantics, optional isAnimated disabling, and wrapperClass merging where applicable.

Changes

Cohort / File(s) Summary of changes
Skeleton partial test additions
tests/partials/ArticleItemSkeletonPartial.test.ts, tests/partials/PostPageSkeletonPartial.test.ts, tests/partials/ProjectCardSkeletonPartial.test.ts, tests/partials/TalkCardSkeletonPartial.test.ts, tests/partials/WidgetSkillsSkeletonPartial.test.ts
Introduces unit tests validating default animate-pulse behavior, aria-hidden/non-interactive state where applicable, isAnimated: false disabling, count/class checks for list items, and wrapperClass merge for ProjectCard skeleton.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

testing

Poem

I thump-thump test with fluffy zeal,
Skeletons pulse; I note the feel.
Toggle a flag—no wiggle, still—
Aria whispers, calm and chill.
In burrows green, my specs delight,
A hop, a pass—all glowing bright. 🐇✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "Add tests for skeleton partial components" accurately and succinctly summarizes the PR’s primary change of adding tests for the skeleton partial components suite. It clearly indicates what is being added and which part of the codebase is affected, enabling quick understanding from the title alone.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

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.

@gocanto gocanto marked this pull request as draft October 3, 2025 07:43
@gemini-code-assist
Copy link

Summary of Changes

Hello @gocanto, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the test suite by adding dedicated Vitest unit tests for various skeleton partial components. The new tests cover critical aspects such as animation toggling, structural rendering, and accessibility attributes, ensuring the robustness and correct behavior of these loading state indicators across the application. This improves the overall quality and maintainability of the UI components.

Highlights

  • New Test Coverage: Introduced comprehensive Vitest unit tests for several skeleton partial components, including ArticleItemSkeletonPartial, PostPageSkeletonPartial, ProjectCardSkeletonPartial, TalkCardSkeletonPartial, and WidgetSkillsSkeletonPartial.
  • Animation Verification: Tests now explicitly verify that skeleton components correctly apply and disable the animate-pulse class based on their isAnimated prop, ensuring proper visual feedback.
  • Structural and Accessibility Checks: Validated the structural integrity of placeholders (e.g., WidgetSkillsSkeletonPartial rendering six list items) and accessibility attributes like aria-hidden for non-interactive elements.
  • Stable Test Identifiers: Ensured that the PostPageSkeletonPartial exposes a stable data-testid attribute, facilitating reliable end-to-end testing.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gocanto gocanto added testing and removed codex labels Oct 3, 2025
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces Vitest test coverage for several skeleton partial components. The tests are a great addition and correctly verify the animation toggling. My review provides feedback to improve test quality and enhance accessibility coverage. I've pointed out a redundant assertion, a test with a logical contradiction, and opportunities to add assertions for the aria-hidden attribute to ensure these decorative components are not exposed to assistive technologies.

Comment on lines 16 to 21
it('is marked as purely decorative', () => {
const wrapper = mount(WidgetSkillsSkeletonPartial);

expect(wrapper.attributes('aria-hidden')).toBeUndefined();
expect(wrapper.classes()).toContain('animate-pulse');
});

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

This test's description, 'is marked as purely decorative', contradicts its assertion. A decorative element should be hidden from assistive technologies with aria-hidden="true". However, the test asserts toBeUndefined(), which means it's exposed to screen readers.

For consistency with other skeleton components and for better accessibility, this component should have aria-hidden="true". This test should be updated to enforce this, which will require a corresponding fix in the WidgetSkillsSkeletonPartial.vue component.

Suggested change
it('is marked as purely decorative', () => {
const wrapper = mount(WidgetSkillsSkeletonPartial);
expect(wrapper.attributes('aria-hidden')).toBeUndefined();
expect(wrapper.classes()).toContain('animate-pulse');
});
it('is marked as purely decorative', () => {
const wrapper = mount(WidgetSkillsSkeletonPartial);
expect(wrapper.attributes('aria-hidden')).toBe('true');
expect(wrapper.classes()).toContain('animate-pulse');
});

it('is animated by default', () => {
const wrapper = mount(ArticleItemSkeletonPartial);

expect(wrapper.classes()).toContain('animate-pulse');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

It's good practice to also assert that skeleton components are hidden from assistive technologies. The component correctly has aria-hidden="true", so please add a check for it in the test.

		expect(wrapper.classes()).toContain('animate-pulse');
		expect(wrapper.attributes('aria-hidden')).toBe('true');

const wrapper = mount(PostPageSkeletonPartial);

const root = wrapper.get('[data-testid="post-page-skeleton"]');
expect(root.exists()).toBe(true);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The wrapper.get() method throws an error if the element is not found, making this expect assertion redundant. The test's purpose is fulfilled by get() succeeding. You can remove this line for a more concise test.


expect(wrapper.classes()).not.toContain('animate-pulse');
});
});

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This test suite is missing a check for accessibility. Skeleton loaders are purely decorative and should be hidden from assistive technologies using aria-hidden="true". Please add a test case to ensure this attribute is present. Note that this will require updating the ProjectCardSkeletonPartial.vue component to include aria-hidden="true" on its root element to make the test pass.

Suggested change
});
});
it('is hidden from assistive technology', () => {
const wrapper = mount(ProjectCardSkeletonPartial);
expect(wrapper.attributes('aria-hidden')).toBe('true');
});

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (2)
tests/partials/ProjectCardSkeletonPartial.test.ts (1)

1-4: Optional: standardize selectors with data-testid

Consider adding data-testid="project-card-skeleton" on the component wrapper and targeting it in tests for stability.

tests/partials/TalkCardSkeletonPartial.test.ts (1)

1-4: Operational: ensure Vitest v3.2.x and alias config

Pin vitest to latest 3.2.x and verify @partials alias is resolved in vitest config to avoid env-only failures. Based on learnings.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ecb889b and 6bcf22c.

📒 Files selected for processing (5)
  • tests/partials/ArticleItemSkeletonPartial.test.ts (1 hunks)
  • tests/partials/PostPageSkeletonPartial.test.ts (1 hunks)
  • tests/partials/ProjectCardSkeletonPartial.test.ts (1 hunks)
  • tests/partials/TalkCardSkeletonPartial.test.ts (1 hunks)
  • tests/partials/WidgetSkillsSkeletonPartial.test.ts (1 hunks)
🧰 Additional context used
🪛 GitHub Actions: Unit Tests
tests/partials/ArticleItemSkeletonPartial.test.ts

[error] 9-9: Assertion failed: ArticleItemSkeletonPartial is animated by default but does not include 'animate-pulse' class.

tests/partials/TalkCardSkeletonPartial.test.ts

[error] 9-9: Assertion failed: TalkCardSkeletonPartial is animated by default but does not include 'animate-pulse' class.

tests/partials/ProjectCardSkeletonPartial.test.ts

[error] 9-9: Assertion failed: ProjectCardSkeletonPartial is animated by default but does not include 'animate-pulse' class.

🪛 GitHub Check: vitest
tests/partials/ArticleItemSkeletonPartial.test.ts

[failure] 9-9: tests/partials/ArticleItemSkeletonPartial.test.ts > ArticleItemSkeletonPartial > is animated by default
AssertionError: expected [ 'py-5', 'border-b', …(2) ] to include 'animate-pulse'
❯ tests/partials/ArticleItemSkeletonPartial.test.ts:9:29

tests/partials/TalkCardSkeletonPartial.test.ts

[failure] 9-9: tests/partials/TalkCardSkeletonPartial.test.ts > TalkCardSkeletonPartial > applies animation by default
AssertionError: expected [ 'relative', 'aspect-video', …(13) ] to include 'animate-pulse'
❯ tests/partials/TalkCardSkeletonPartial.test.ts:9:29

tests/partials/ProjectCardSkeletonPartial.test.ts

[failure] 9-9: tests/partials/ProjectCardSkeletonPartial.test.ts > ProjectCardSkeletonPartial > renders animated wrapper by default
AssertionError: expected [ 'rounded-lg', 'border', …(6) ] to include 'animate-pulse'
❯ tests/partials/ProjectCardSkeletonPartial.test.ts:9:29

🔇 Additional comments (3)
tests/partials/WidgetSkillsSkeletonPartial.test.ts (1)

5-22: LGTM

Tests are clear and focused; assertions on item count and classes are good.

tests/partials/PostPageSkeletonPartial.test.ts (1)

5-19: LGTM

Stable test id + accessibility and animation checks look good.

tests/partials/ProjectCardSkeletonPartial.test.ts (1)

6-10: Retain wrapper.classes() assertions — animate-pulse is bound on the root element.

Likely an incorrect or invalid review comment.

Comment on lines 6 to 10
it('is animated by default', () => {
const wrapper = mount(ArticleItemSkeletonPartial);

expect(wrapper.classes()).toContain('animate-pulse');
});
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Make animation checks resilient to non-root placement

Search for a descendant with the animation class; ensure disabled case asserts none exist.

Apply this diff:

@@
   it('is animated by default', () => {
     const wrapper = mount(ArticleItemSkeletonPartial);
 
-    expect(wrapper.classes()).toContain('animate-pulse');
+    expect(wrapper.find('.animate-pulse').exists()).toBe(true);
   });
@@
   it('can disable the animation', () => {
     const wrapper = mount(ArticleItemSkeletonPartial, {
       props: { isAnimated: false },
     });
 
-    expect(wrapper.classes()).not.toContain('animate-pulse');
+    expect(wrapper.find('.animate-pulse').exists()).toBe(false);
   });

Also applies to: 12-18

🧰 Tools
🪛 GitHub Actions: Unit Tests

[error] 9-9: Assertion failed: ArticleItemSkeletonPartial is animated by default but does not include 'animate-pulse' class.

🪛 GitHub Check: vitest

[failure] 9-9: tests/partials/ArticleItemSkeletonPartial.test.ts > ArticleItemSkeletonPartial > is animated by default
AssertionError: expected [ 'py-5', 'border-b', …(2) ] to include 'animate-pulse'
❯ tests/partials/ArticleItemSkeletonPartial.test.ts:9:29

🤖 Prompt for AI Agents
In tests/partials/ArticleItemSkeletonPartial.test.ts around lines 6-10 (and
similarly update lines 12-18), the tests assume the animation class is on the
root element; change them to search for a descendant with the animation class
instead and update the disabled-case assertion to assert no descendant exists:
use the wrapper.find or wrapper.findAll API to look for '.animate-pulse' and
assert .exists() is true for the default/animated test and false (or length ===
0) for the disabled test so the checks remain resilient to non-root placement.

Comment on lines 6 to 11
it('applies animation by default', () => {
const wrapper = mount(TalkCardSkeletonPartial);

expect(wrapper.classes()).toContain('animate-pulse');
expect(wrapper.attributes('aria-hidden')).toBe('true');
});
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Fix failing animation assertions to target descendant

Component likely doesn’t set animate-pulse on root. Search for a descendant instead; ensure disabled asserts none exist.

Apply this diff:

@@
   it('applies animation by default', () => {
     const wrapper = mount(TalkCardSkeletonPartial);
 
-    expect(wrapper.classes()).toContain('animate-pulse');
+    expect(wrapper.find('.animate-pulse').exists()).toBe(true);
     expect(wrapper.attributes('aria-hidden')).toBe('true');
   });
@@
   it('respects disabled animation flag', () => {
     const wrapper = mount(TalkCardSkeletonPartial, {
       props: { isAnimated: false },
     });
 
-    expect(wrapper.classes()).not.toContain('animate-pulse');
+    expect(wrapper.find('.animate-pulse').exists()).toBe(false);
   });

Also applies to: 13-19

🧰 Tools
🪛 GitHub Actions: Unit Tests

[error] 9-9: Assertion failed: TalkCardSkeletonPartial is animated by default but does not include 'animate-pulse' class.

🪛 GitHub Check: vitest

[failure] 9-9: tests/partials/TalkCardSkeletonPartial.test.ts > TalkCardSkeletonPartial > applies animation by default
AssertionError: expected [ 'relative', 'aspect-video', …(13) ] to include 'animate-pulse'
❯ tests/partials/TalkCardSkeletonPartial.test.ts:9:29

🤖 Prompt for AI Agents
In tests/partials/TalkCardSkeletonPartial.test.ts around lines 6-11 and 13-19,
the assertions are checking the root element for the 'animate-pulse' class but
the component applies that class to a descendant; update the test to query the
descendant element (e.g., using wrapper.find or wrapper.findComponent with the
selector/class for the animated element) and assert that the descendant
hasClass('animate-pulse') for the default case, and for the disabled case assert
that no matching descendant exists or that it does not have the 'animate-pulse'
class.

@gocanto gocanto closed this Oct 3, 2025
@gocanto gocanto deleted the gocanto/check-and-stabilize-test-suite-2025-10-03 branch October 3, 2025 07:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants