Skip to content

test: more tests on TailwindCSS configuration#74

Merged
colinaaa merged 1 commit intorstackjs:mainfrom
colinaaa:colin/0225/test
Feb 25, 2026
Merged

test: more tests on TailwindCSS configuration#74
colinaaa merged 1 commit intorstackjs:mainfrom
colinaaa:colin/0225/test

Conversation

@colinaaa
Copy link
Copy Markdown
Collaborator

No description provided.

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @colinaaa, 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 expands the test suite for the TailwindCSS plugin, ensuring proper functionality across various configuration scenarios. It introduces dedicated tests for custom plugins, CSS prefixing, and theme extensions, thereby enhancing the reliability and stability of the plugin's integration with Rsbuild.

Highlights

  • New Test Cases for TailwindCSS Plugin: Added comprehensive test cases to validate the functionality of the TailwindCSS plugin, covering various configuration aspects.
  • Plugin Utility Verification: Introduced tests to ensure that custom utilities defined via TailwindCSS plugins are correctly applied and rendered.
  • Prefix Configuration Validation: Included tests to confirm that TailwindCSS classes with custom prefixes are correctly processed and styled.
  • Theme Extension Testing: Added tests to verify that custom theme extensions, such as new colors, are properly integrated and applied.
  • Test Stability Improvements: Enhanced the robustness of existing Playwright tests by adding waitForSelector calls to ensure elements are present before interaction.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • test/plugin/config/tailwind.config.js
    • Added a TailwindCSS configuration file that defines a custom plugin utility.
  • test/plugin/index.test.ts
    • Added a Playwright test to verify the application of a custom TailwindCSS plugin utility.
  • test/plugin/src/index.js
    • Added a JavaScript entry file that applies a custom TailwindCSS plugin utility to an element.
  • test/prefix/config/tailwind.config.js
    • Added a TailwindCSS configuration file that sets a custom prefix for utility classes.
  • test/prefix/index.test.ts
    • Added a Playwright test to verify the correct application of TailwindCSS classes with a custom prefix.
  • test/prefix/src/index.js
    • Added a JavaScript entry file that applies a custom prefixed TailwindCSS utility class to an element.
  • test/theme/config/tailwind.config.js
    • Added a TailwindCSS configuration file that extends the default theme with a custom color.
  • test/theme/index.test.ts
    • Added a Playwright test to verify the application of a custom theme color defined in TailwindCSS.
  • test/theme/src/index.js
    • Added a JavaScript entry file that applies a custom theme color utility class to an element.
  • test/with-resource-query/index.test.ts
    • Updated existing Playwright tests to include page.waitForSelector calls for improved stability and reliability.
Activity
  • No human activity has occurred on this pull request yet.
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.

@colinaaa colinaaa enabled auto-merge (squash) February 25, 2026 04:13
@colinaaa colinaaa merged commit b0e739b into rstackjs:main Feb 25, 2026
4 checks passed
Copy link
Copy Markdown

@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 adds a good set of tests for various TailwindCSS configuration options, including plugins, prefixes, and themes. The changes also improve existing tests by ensuring elements are present before interaction. My review focuses on suggesting a more idiomatic way to write the Playwright tests using locators, which can improve readability and robustness.

Comment thread test/plugin/index.test.ts
Comment on lines +37 to +51
await page.waitForSelector('#test', { state: 'attached' });

const style = await page.evaluate(() => {
const el = document.getElementById('test');

if (!el) {
throw new Error('#test not found');
}

const computed = window.getComputedStyle(el);
return {
position: computed.getPropertyValue('position'),
top: computed.getPropertyValue('top'),
};
});
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

For better readability and to leverage Playwright's auto-waiting mechanism, it's recommended to use page.locator() to select elements. This avoids manual waitForSelector and simplifies the code by removing the need to manually find the element and check for its existence within page.evaluate(). Using locators makes the test more robust and idiomatic.

    const style = await page.locator('#test').evaluate((el) => {
      const computed = window.getComputedStyle(el);
      return {
        position: computed.getPropertyValue('position'),
        top: computed.getPropertyValue('top'),
      };
    });

Comment thread test/prefix/index.test.ts
Comment on lines +37 to +47
await page.waitForSelector('#test', { state: 'attached' });

const display = await page.evaluate(() => {
const el = document.getElementById('test');

if (!el) {
throw new Error('#test not found');
}

return window.getComputedStyle(el).getPropertyValue('display');
});
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

For better readability and to leverage Playwright's auto-waiting mechanism, it's recommended to use page.locator() to select elements. This avoids manual waitForSelector and simplifies the code by removing the need to manually find the element and check for its existence within page.evaluate(). Using locators makes the test more robust and idiomatic.

    const display = await page
      .locator('#test')
      .evaluate((el) => window.getComputedStyle(el).getPropertyValue('display'));

Comment thread test/theme/index.test.ts
Comment on lines +37 to +47
await page.waitForSelector('#test', { state: 'attached' });

const color = await page.evaluate(() => {
const el = document.getElementById('test');

if (!el) {
throw new Error('#test not found');
}

return window.getComputedStyle(el).getPropertyValue('color');
});
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

For better readability and to leverage Playwright's auto-waiting mechanism, it's recommended to use page.locator() to select elements. This avoids manual waitForSelector and simplifies the code by removing the need to manually find the element and check for its existence within page.evaluate(). Using locators makes the test more robust and idiomatic.

    const color = await page
      .locator('#test')
      .evaluate((el) => window.getComputedStyle(el).getPropertyValue('color'));

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