Williams-RE / WRE-website

For home-buyers to see real estate listings nearby.
https://williamsrealestates.com
0 stars 0 forks source link

Add e2e tests #23

Closed timeowilliams closed 2 months ago

timeowilliams commented 2 months ago

Description

Type of change

Testing

Screenshots/Screen Recordings :

Notes

Summary by CodeRabbit

railway-app[bot] commented 2 months ago
πŸš… Deployed to the WRE-website-pr-23 environment in WRE Frontend Service Status Web Updated (UTC)
coderabbitai[bot] commented 2 months ago

Walkthrough

This set of changes includes modifications to the .env file for production readiness, the introduction of a GitHub Actions workflow for Playwright testing, enhancements to the .gitignore file, and updates to the README.md for clearer documentation. Various components received improved validation mechanisms, and new end-to-end tests were created to ensure correct functionality in contact forms and listings.

Changes

Files Change Summary
.env Updated REACT_APP_SERVER_URL to production URL; added BASE_URL, TEST_USERNAME, and TEST_PASSWORD; removed JWT_SECRET and REACT_APP_POSTHOG_API_KEY.
.github/workflows/playwright_tests.yml New workflow created for Playwright tests on pull requests, installing dependencies and running tests with report uploads.
.gitignore Added playwright-report and test-results to ignored files.
README.md Added instructions for installing Playwright and running end-to-end tests.
package.json Replaced "test" with "test:e2e" for Playwright testing; added several new dependencies for testing and environment management.
playwright.config.js New configuration file for Playwright with settings for test directory, timeout, and browser options.
src/components/* Enhanced form validation and error handling in AddListing.jsx and ModalButton.jsx; added data-testid attributes in BuyerBrokerTable.jsx.
src/lib/utils.js Added validation functions; included console log in sendEmail function for better traceability.
tests/e2e/* New end-to-end test files for contact form, listings, and navigation, ensuring functionality works as expected.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant UI
    participant Server
    User->>UI: Fill out contact form
    UI->>Server: Submit contact form
    Server-->>UI: Confirm submission
    UI-->>User: Show success notification

🐰 Hopping through the code, oh what a delight,
With new tests and forms, everything feels right!
Validations are strong, errors now clear,
A joyful release, let’s all give a cheer!
Testing and toasting, let’s dance and rejoice,
For in our code, we’ve found our true voice! 🌟


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)
Tips ### Chat There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai): - Review comments: Directly reply to a review comment made by CodeRabbit. Example: - `I pushed a fix in commit .` - `Generate unit testing code for this file.` - `Open a follow-up GitHub issue for this discussion.` - Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples: - `@coderabbitai generate unit testing code for this file.` - `@coderabbitai modularize this function.` - PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples: - `@coderabbitai generate interesting stats about this repository and render them as a table.` - `@coderabbitai show all the console.log statements in this repository.` - `@coderabbitai read src/utils.ts and generate unit testing code.` - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.` - `@coderabbitai help me debug CodeRabbit configuration file.` Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. ### CodeRabbit Commands (invoked as PR comments) - `@coderabbitai pause` to pause the reviews on a PR. - `@coderabbitai resume` to resume the paused reviews. - `@coderabbitai review` to trigger an incremental review. This is useful when automatic reviews are disabled for the repository. - `@coderabbitai full review` to do a full review from scratch and review all the files again. - `@coderabbitai summary` to regenerate the summary of the PR. - `@coderabbitai resolve` resolve all the CodeRabbit review comments. - `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository. - `@coderabbitai help` to get help. Additionally, you can add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed. ### CodeRabbit Configuration File (`.coderabbit.yaml`) - You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository. - Please see the [configuration documentation](https://docs.coderabbit.ai/guides/configure-coderabbit) for more information. - If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json` ### Documentation and Community - Visit our [Documentation](https://coderabbit.ai/docs) for detailed information on how to use CodeRabbit. - Join our [Discord Community](https://discord.com/invite/GsXnASn26c) to get help, request features, and share feedback. - Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.
github-actions[bot] commented 2 months ago

πŸ“Š Package size report   0.3%↑

File Before After
.github/workflows/playwright_tests.yml β€” 954 B
package.json 1.3 kB 10%↑1.4 kB
playwright.config.js β€” 426 B
README.md 789 B 10%↑867 B
src/components/AddListing.jsx 5.6 kB 55%↑8.6 kB
src/components/BuyerBrokerTable.jsx 7.9 kB 2%↑8.1 kB
src/components/ModalButton.jsx 4.7 kB 32%↑6.3 kB
src/lib/utils.js 1.3 kB 83%↑2.3 kB
tests/e2e/contact.spec.js β€” 1.4 kB
tests/e2e/listings.spec.js β€” 2.9 kB
tests/e2e/navigation.spec.js β€” 1.7 kB
Total (Includes all files) 4.4 MB 0.3%↑4.4 MB
Tarball size 4.3 MB 0.09%↑4.3 MB
Unchanged files | File | Size | | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------: | | [`.github/pull_request_template.md`](https://github.com/Williams-RE/WRE-website/blob/add-e2e-tests/.github/pull_request_template.md) | `688 B` | | [`.github/workflows/check_source_code.yml`](https://github.com/Williams-RE/WRE-website/blob/add-e2e-tests/.github/workflows/check_source_code.yml) | `353 B` | | [`.github/workflows/package_size.yml`](https://github.com/Williams-RE/WRE-website/blob/add-e2e-tests/.github/workflows/package_size.yml) | `504 B` | | [`public/ics.ics`](https://github.com/Williams-RE/WRE-website/blob/add-e2e-tests/public/ics.ics) | `1.4 kB` | | [`public/index.html`](https://github.com/Williams-RE/WRE-website/blob/add-e2e-tests/public/index.html) | `490 B` | | `public/W icon.ico` | `13.6 kB` | | `public/W logo.svg` | `1.1 kB` | | [`src/App.css`](https://github.com/Williams-RE/WRE-website/blob/add-e2e-tests/src/App.css) | `2.8 kB` | | [`src/App.js`](https://github.com/Williams-RE/WRE-website/blob/add-e2e-tests/src/App.js) | `3.5 kB` | | [`src/assets/background-large.avif`](https://github.com/Williams-RE/WRE-website/blob/add-e2e-tests/src/assets/background-large.avif) | `280.9 kB` | | [`src/assets/background-small.avif`](https://github.com/Williams-RE/WRE-website/blob/add-e2e-tests/src/assets/background-small.avif) | `247.7 kB` | | [`src/assets/buy-a-home/finding-the-deal.avif`](https://github.com/Williams-RE/WRE-website/blob/add-e2e-tests/src/assets/buy-a-home/finding-the-deal.avif) | `37.9 kB` | | [`src/assets/buy-a-home/illustrations/illustration1.avif`](https://github.com/Williams-RE/WRE-website/blob/add-e2e-tests/src/assets/buy-a-home/illustrations/illustration1.avif) | `142.4 kB` | | [`src/assets/buy-a-home/illustrations/illustration2.avif`](https://github.com/Williams-RE/WRE-website/blob/add-e2e-tests/src/assets/buy-a-home/illustrations/illustration2.avif) | `144.2 kB` | | [`src/assets/buy-a-home/illustrations/illustration3.avif`](https://github.com/Williams-RE/WRE-website/blob/add-e2e-tests/src/assets/buy-a-home/illustrations/illustration3.avif) | `127.4 kB` | | [`src/assets/buy-a-home/illustrations/update1-03.avif`](https://github.com/Williams-RE/WRE-website/blob/add-e2e-tests/src/assets/buy-a-home/illustrations/update1-03.avif) | `173.8 kB` | | [`src/assets/buy-a-home/illustrations/update2-02.avif`](https://github.com/Williams-RE/WRE-website/blob/add-e2e-tests/src/assets/buy-a-home/illustrations/update2-02.avif) | `155.0 kB` | | [`src/assets/buy-a-home/illustrations/update3-03.avif`](https://github.com/Williams-RE/WRE-website/blob/add-e2e-tests/src/assets/buy-a-home/illustrations/update3-03.avif) | `108.9 kB` | | [`src/assets/buy-a-home/sealing-the-deal.avif`](https://github.com/Williams-RE/WRE-website/blob/add-e2e-tests/src/assets/buy-a-home/sealing-the-deal.avif) | `104.3 kB` | | [`src/assets/close-modal.avif`](https://github.com/Williams-RE/WRE-website/blob/add-e2e-tests/src/assets/close-modal.avif) | `2.7 kB` | | [`src/assets/icon_pencil.svg`](https://github.com/Williams-RE/WRE-website/blob/add-e2e-tests/src/assets/icon_pencil.svg) | `367 B` | | [`src/assets/scale.webp`](https://github.com/Williams-RE/WRE-website/blob/add-e2e-tests/src/assets/scale.webp) | `356.7 kB` | | [`src/assets/sell-a-home/before-you-start.avif`](https://github.com/Williams-RE/WRE-website/blob/add-e2e-tests/src/assets/sell-a-home/before-you-start.avif) | `296.8 kB` | | [`src/assets/sell-a-home/finding-the-deal.avif`](https://github.com/Williams-RE/WRE-website/blob/add-e2e-tests/src/assets/sell-a-home/finding-the-deal.avif) | `781.5 kB` | | [`src/assets/sell-a-home/illustrations/illustration4.avif`](https://github.com/Williams-RE/WRE-website/blob/add-e2e-tests/src/assets/sell-a-home/illustrations/illustration4.avif) | `94.2 kB` | | [`src/assets/sell-a-home/illustrations/illustration5.avif`](https://github.com/Williams-RE/WRE-website/blob/add-e2e-tests/src/assets/sell-a-home/illustrations/illustration5.avif) | `126.0 kB` | | [`src/assets/sell-a-home/illustrations/illustration6.avif`](https://github.com/Williams-RE/WRE-website/blob/add-e2e-tests/src/assets/sell-a-home/illustrations/illustration6.avif) | `82.0 kB` | | [`src/assets/sell-a-home/illustrations/update5-05.avif`](https://github.com/Williams-RE/WRE-website/blob/add-e2e-tests/src/assets/sell-a-home/illustrations/update5-05.avif) | `121.4 kB` | | [`src/assets/sell-a-home/sealing-the-deal.avif`](https://github.com/Williams-RE/WRE-website/blob/add-e2e-tests/src/assets/sell-a-home/sealing-the-deal.avif) | `944.8 kB` | | [`src/assets/wre-logo.png`](https://github.com/Williams-RE/WRE-website/blob/add-e2e-tests/src/assets/wre-logo.png) | `7.4 kB` | | [`src/components/AboutUs.css`](https://github.com/Williams-RE/WRE-website/blob/add-e2e-tests/src/components/AboutUs.css) | `2.5 kB` | | [`src/components/AboutUs.jsx`](https://github.com/Williams-RE/WRE-website/blob/add-e2e-tests/src/components/AboutUs.jsx) | `4.4 kB` | | [`src/components/AgentProfile.css`](https://github.com/Williams-RE/WRE-website/blob/add-e2e-tests/src/components/AgentProfile.css) | `683 B` | | [`src/components/AgentProfile.jsx`](https://github.com/Williams-RE/WRE-website/blob/add-e2e-tests/src/components/AgentProfile.jsx) | `1.2 kB` | | [`src/components/BuyAHome.css`](https://github.com/Williams-RE/WRE-website/blob/add-e2e-tests/src/components/BuyAHome.css) | `6.9 kB` | | [`src/components/BuyAHome.jsx`](https://github.com/Williams-RE/WRE-website/blob/add-e2e-tests/src/components/BuyAHome.jsx) | `7.0 kB` | | [`src/components/BuyerBrokerTable.css`](https://github.com/Williams-RE/WRE-website/blob/add-e2e-tests/src/components/BuyerBrokerTable.css) | `1.6 kB` | | [`src/components/LandingPage.css`](https://github.com/Williams-RE/WRE-website/blob/add-e2e-tests/src/components/LandingPage.css) | `717 B` | | [`src/components/LandingPage.jsx`](https://github.com/Williams-RE/WRE-website/blob/add-e2e-tests/src/components/LandingPage.jsx) | `1.3 kB` | | [`src/components/Listing.css`](https://github.com/Williams-RE/WRE-website/blob/add-e2e-tests/src/components/Listing.css) | `576 B` | | [`src/components/Listing.jsx`](https://github.com/Williams-RE/WRE-website/blob/add-e2e-tests/src/components/Listing.jsx) | `829 B` | | [`src/components/ListingsLayout.css`](https://github.com/Williams-RE/WRE-website/blob/add-e2e-tests/src/components/ListingsLayout.css) | `78 B` | | [`src/components/ListingsLayout.jsx`](https://github.com/Williams-RE/WRE-website/blob/add-e2e-tests/src/components/ListingsLayout.jsx) | `859 B` | | [`src/components/ListingsManager.jsx`](https://github.com/Williams-RE/WRE-website/blob/add-e2e-tests/src/components/ListingsManager.jsx) | `641 B` | | [`src/components/Login.css`](https://github.com/Williams-RE/WRE-website/blob/add-e2e-tests/src/components/Login.css) | `1.2 kB` | | [`src/components/Login.jsx`](https://github.com/Williams-RE/WRE-website/blob/add-e2e-tests/src/components/Login.jsx) | `2.2 kB` | | [`src/components/ModalButton.css`](https://github.com/Williams-RE/WRE-website/blob/add-e2e-tests/src/components/ModalButton.css) | `2.9 kB` | | [`src/components/NavBar.css`](https://github.com/Williams-RE/WRE-website/blob/add-e2e-tests/src/components/NavBar.css) | `2.0 kB` | | [`src/components/NavBar.jsx`](https://github.com/Williams-RE/WRE-website/blob/add-e2e-tests/src/components/NavBar.jsx) | `2.3 kB` | | [`src/components/SellAHome.css`](https://github.com/Williams-RE/WRE-website/blob/add-e2e-tests/src/components/SellAHome.css) | `4.5 kB` | | [`src/components/SellAHome.jsx`](https://github.com/Williams-RE/WRE-website/blob/add-e2e-tests/src/components/SellAHome.jsx) | `4.9 kB` | | [`src/contexts/AgentContext.js`](https://github.com/Williams-RE/WRE-website/blob/add-e2e-tests/src/contexts/AgentContext.js) | `829 B` | | [`src/index.css`](https://github.com/Williams-RE/WRE-website/blob/add-e2e-tests/src/index.css) | `366 B` | | [`src/index.js`](https://github.com/Williams-RE/WRE-website/blob/add-e2e-tests/src/index.js) | `231 B` | | [`src/lib/react-multi-carousel.css`](https://github.com/Williams-RE/WRE-website/blob/add-e2e-tests/src/lib/react-multi-carousel.css) | `3.0 kB` |

πŸ€– This report was automatically generated by pkg-size-action