Skip to content

E2e UI tests#10

Merged
cs-util merged 8 commits into
mainfrom
e2eUiTests
Oct 15, 2025
Merged

E2e UI tests#10
cs-util merged 8 commits into
mainfrom
e2eUiTests

Conversation

@cs-util
Copy link
Copy Markdown
Owner

@cs-util cs-util commented Oct 15, 2025

This pull request updates documentation to improve clarity, consistency, and code style in both the code coverage ignore guidelines and the Three.js test environment playbook. The main changes involve normalizing code examples to use single quotes, updating formatting to match modern JavaScript/TypeScript conventions, and clarifying instructions and examples for coverage ignores and test setups.

Code Coverage Ignore Guidelines (docs/codeCoverageIgnoreGuidelines.md):

  • Code style and formatting improvements:

    • Standardized all code examples and configuration snippets to use single quotes instead of double quotes for consistency. [1] [2] [3]
    • Reformatted TypeScript and JavaScript code blocks for readability, including consistent indentation and semicolon usage. [1] [2] [3]
    • Updated list formatting and checklist items for better clarity and visual consistency. [1] [2]
  • Clarifications and minor text updates:

    • Improved explanations and examples for when and how to use coverage ignore comments, with clearer distinction between acceptable and unacceptable uses. [1] [2]
    • Enhanced sample scripts and ESLint configuration to better enforce inline reasons for ignore comments. [1] [2]

Three.js Test Environment Playbook (docs/threeJs un test environments.md):

  • Code style and formatting improvements:

    • Converted all code and config examples to use single quotes for consistency. [1] [2] [3] [4] [5] [6]
    • Updated list formatting and improved section structure for easier reading and application. [1] [2]
  • Clarifications and minor text updates:

    • Improved explanations for setting up Node, jsdom, and Playwright environments for Three.js testing, with clearer instructions and updated notes on ESM and canvas handling. [1] [2] [3]

These changes make the documentation more consistent and easier to follow for both code style and testing best practices.

References:
[1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19]

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @cs-util, 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 focuses on enhancing the quality and usability of the project's documentation and testing infrastructure. It standardizes code style within documentation, particularly by enforcing single quotes and improving code block formatting. Additionally, it refines guidelines for code coverage ignores and provides clearer instructions for setting up various Three.js testing environments, ensuring that developers have up-to-date and consistent resources. A new dedicated script for running specific end-to-end tests has also been introduced to streamline the testing workflow.

Highlights

  • Documentation Clarity and Consistency: Updated two key documentation files (codeCoverageIgnoreGuidelines.md and threeJs un test environments.md) to improve clarity, consistency, and adherence to modern code style conventions.
  • Code Style Standardization: Standardized code examples and configuration snippets across documentation to consistently use single quotes and improved formatting for readability.
  • Improved Coverage Ignore Guidelines: Clarified explanations and examples for when and how to use code coverage ignore comments, including enhanced sample scripts and ESLint configuration to enforce inline reasons.
  • Enhanced Three.js Testing Playbook: Refined instructions and examples for setting up Node, jsdom, and Playwright environments for Three.js testing, with clearer notes on ESM and canvas handling.
  • New E2E Test Script: Added a new npm script (test:e2e:index) to specifically run Playwright UI tests for the index.spec.js file, and integrated it into the main npm test command.
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.

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 does a great job of improving documentation clarity and standardizing code style, particularly by enforcing the use of single quotes and improving formatting. The changes make the documentation easier to read and maintain. I've found a few minor inconsistencies with the single-quote rule in the documentation files that could be addressed. Additionally, I've identified a potential issue in the Playwright test where a fixed timeout has been added, which is generally considered an anti-pattern and could lead to test flakiness. My detailed comments provide suggestions to resolve these points.

await page.waitForLoadState('networkidle', { timeout: 10000 });
} catch (error) {
} catch {
await page.waitForLoadState('load');
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

high

Adding a fixed waitForTimeout is an anti-pattern in Playwright tests as it can lead to flaky and slower tests. It's often a temporary fix for race conditions. Instead of a fixed wait, it's better to rely on Playwright's web-first assertions and auto-waiting capabilities to ensure the page is in the desired state. For example, you could wait for a specific element that indicates the page has fully loaded before checking for console errors. Please consider removing this line.

Comment on lines +217 to +221
"istanbul ignore next",
"istanbul ignore if",
"istanbul ignore else",
"istanbul ignore file",
"c8 ignore next"
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

The strings in the terms array are still using double quotes. This is inconsistent with the goal of this pull request to standardize on single quotes. For consistency, these should be updated to use single quotes.

Suggested change
"istanbul ignore next",
"istanbul ignore if",
"istanbul ignore else",
"istanbul ignore file",
"c8 ignore next"
'istanbul ignore next',
'istanbul ignore if',
'istanbul ignore else',
'istanbul ignore file',
'c8 ignore next'

import "canvas"; // jsdom will pick this up automatically (peer dep)
import 'canvas'; // jsdom will pick this up automatically (peer dep)
// Or, alternative: jest-canvas-mock if you only need basic APIs:
// import "jest-canvas-mock";
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

This commented-out import statement still uses double quotes. To maintain consistency with the goal of this PR to standardize on single quotes, it should also be updated.

Suggested change
// import "jest-canvas-mock";
// import 'jest-canvas-mock';

… push on failure, plus extended tests-and-lint-as-precommit-hook.md with setup steps, execution notes, and a quick verification hint
…t before the Playwright run, keeping e2e isolated. (package.json)

Added test:core that chains format, lint, dependency checks, and unit/property tests for reuse in CI and locally. (package.json)
Pointed the CI workflow’s test job at npm run test:core, allowing the GitHub Action to skip Playwright setup. (ci.yml)
@cs-util cs-util merged commit 957934d into main Oct 15, 2025
6 checks passed
@cs-util cs-util deleted the e2eUiTests branch October 15, 2025 07:55
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