Skip to content

[ENG-1038] e2e tests for Google Sheets & Hutspot#172

Merged
davidrojasliblab merged 19 commits intomainfrom
dr/ENG-1038-sheets-hutspot
Sep 25, 2025
Merged

[ENG-1038] e2e tests for Google Sheets & Hutspot#172
davidrojasliblab merged 19 commits intomainfrom
dr/ENG-1038-sheets-hutspot

Conversation

@davidrojasliblab
Copy link
Contributor

📋 Pull Request Summary

E2E for google sheets and huspot

🔗 Related Issues

https://linear.app/liblab/issue/ENG-1038/create-every-available-data-source-through-settings

Copy link
Contributor

@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.

Summary of Changes

Hello @davidrojasliblab, 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 coverage for data source integrations by introducing new end-to-end tests for Google Sheets and HubSpot. These tests validate the entire user journey for creating these data sources, from form input and validation to authentication flows (OAuth for Google Sheets, API token for HubSpot) and error handling. The goal is to ensure the robustness and reliability of these critical data source integrations within the application.

Highlights

  • Google Sheets E2E Tests: Added new end-to-end tests for the Google Sheets data source creation flow, covering scenarios like public spreadsheet URL submission, OAuth flow validation, and error handling.
  • HubSpot E2E Tests: Introduced new end-to-end tests for the HubSpot data source creation, including comprehensive validation of access token formats, required fields, and API-level error handling.
  • Documentation Renaming: The Google Sheets integration documentation file has been renamed from docs/getting-started/google-sheets-integration.md to docs/data-sources/google-sheets.md for better organization.
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
Contributor

@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 end-to-end tests for the Google Sheets and HubSpot data source creation flows, which is a great step towards improving application stability. The tests are comprehensive, covering creation, validation, and error handling scenarios. My review focuses on improving the reliability and maintainability of these new tests. The main points are:

  • Removing try...catch blocks that swallow assertion failures, which can make tests unreliable.
  • Avoiding premature test exits that can lead to silently passing tests.
  • Reducing code duplication by extracting repeated selectors.
  • Cleaning up excessive logging to improve test output clarity.
    These changes will make the new E2E test suite more robust and easier to maintain.

await tokenInput.waitFor({ state: 'visible', timeout: 10000 });

// Use real token from environment variable if available, otherwise use test token
const hubspotToken = process.env.HUBSPOT_ACCESS_TOKEN || 'pat-na1-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx';
Copy link
Contributor

Choose a reason for hiding this comment

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

will test token work in this test?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, the test token won't work for actual API calls - it's a placeholder format.

The test is designed to handle this scenario:

  1. With real token (process.env.HUBSPOT_ACCESS_TOKEN): Full API validation occurs
  2. With test token: We expect 401/403 responses, which the test handles gracefully

The test validates:

  • Form behavior (button states, field validation)
  • API error handling when authentication fails
  • UI feedback for invalid tokens

This approach ensures the test passes in CI (where no real token exists) while still validating the
complete flow when run locally with real credentials. The test focuses on the application's error
handling rather than HubSpot API connectivity.

Testing strategy:
The test covers what matters most for the application logic - form validation, button states, error
handling, and API response processing - rather than external service availability.

@kapicic
Copy link
Contributor

kapicic commented Sep 25, 2025

The tests are failing, can we fix them?

@davidrojasliblab
Copy link
Contributor Author

The tests are failing, can we fix them?

@kapicic done ✅

@davidrojasliblab davidrojasliblab merged commit 1c828cd into main Sep 25, 2025
5 checks passed
@davidrojasliblab davidrojasliblab deleted the dr/ENG-1038-sheets-hutspot branch September 25, 2025 20:27
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.

5 participants