Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add tests for dynamic open graph tags #1130

Closed
wants to merge 5 commits into from

Conversation

helios2003
Copy link
Contributor

Description
Added tests for the dynamic open graph tags added in #1122 using jest.

Copy link

changeset-bot bot commented Aug 20, 2024

⚠️ No Changeset found

Latest commit: 032a980

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

netlify bot commented Aug 20, 2024

Deploy Preview for studio-next failed.

Name Link
🔨 Latest commit 032a980
🔍 Latest deploy log https://app.netlify.com/sites/studio-next/deploys/66df2fcaef9f190008f434f3

Copy link

netlify bot commented Aug 20, 2024

Deploy Preview for modest-rosalind-098b67 failed.

Name Link
🔨 Latest commit 032a980
🔍 Latest deploy log https://app.netlify.com/sites/modest-rosalind-098b67/deploys/66df2fca66157000084000fb

Copy link

netlify bot commented Aug 20, 2024

Deploy Preview for asyncapi-studio-design-system ready!

Name Link
🔨 Latest commit 032a980
🔍 Latest deploy log https://app.netlify.com/sites/asyncapi-studio-design-system/deploys/66df2fcaeee7320008d56e9d
😎 Deploy Preview https://deploy-preview-1130--asyncapi-studio-design-system.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@helios2003
Copy link
Contributor Author

The tests can be run with pnpm test. It works for my tests but for some reason, it fails the tests written in studio-next/src/services/tests. The stack trace is as follows:

FAIL  src/services/tests/navigation.service.test.ts
  ● Test suite failed to run
                                                                                                                                                            
    Cannot find module '@/helpers' from 'src/components/common/Dropdown.tsx'                                                                                
                                                                                                                                                            
    Require stack:                                                                                                                                          
      src/components/common/Dropdown.tsx                                                                                                                    
      src/components/common/index.ts                                                                                                                        
      src/components/Modals/Generator/TemplateParameters.tsx                                                                                                
      src/components/Modals/Generator/GeneratorModal.tsx
      src/components/Modals/index.tsx
      src/services/app.service.ts
      src/services/index.ts
      src/services/tests/navigation.service.test.ts

      1 | import { useState, useRef } from 'react';
      2 |
    > 3 | import { useOutsideClickCallback } from '@/helpers';
        | ^
      4 |
      5 | import type { FunctionComponent, PropsWithChildren, ReactNode } from 'react';
      6 |

      at Resolver._throwModNotFoundError (../../node_modules/.pnpm/[email protected]/node_modules/jest-resolve/build/resolver.js:427:11)
      at Object.<anonymous> (src/components/common/Dropdown.tsx:3:1)
      at Object.<anonymous> (src/components/common/index.ts:3:1)
      at Object.<anonymous> (src/components/Modals/Generator/TemplateParameters.tsx:4:1)
      at Object.<anonymous> (src/components/Modals/Generator/GeneratorModal.tsx:7:1)
      at Object.<anonymous> (src/components/Modals/index.tsx:1:1)
      at Object.<anonymous> (src/services/app.service.ts:5:1)
      at Object.<anonymous> (src/services/index.ts:5:1)
      at Object.<anonymous> (src/services/tests/navigation.service.test.ts:1:1)

Can someone point me to the right direction of how I should go about resolving the issue?

@asyncapi-bot
Copy link
Contributor

Hello, @helios2003! 👋🏼

    I'm 🧞🧞🧞 Genie 🧞🧞🧞 from the magic lamp. Looks like somebody needs a hand!

    At the moment the following comments are supported in pull requests:

    - `/please-take-a-look` or `/ptal` - This comment will add a comment to the PR asking for attention from the reviewrs who have not reviewed the PR yet.
    - `/ready-to-merge` or `/rtm` - This comment will trigger automerge of PR in case all required checks are green, approvals in place and do-not-merge label is not added
    - `/do-not-merge` or `/dnm` - This comment will block automerging even if all conditions are met and ready-to-merge label is added
    - `/autoupdate` or `/au` - This comment will add `autoupdate` label to the PR and keeps your PR up-to-date to the target branch's future changes. Unless there is a merge conflict or it is a draft PR. (Currently only works for upstream branches.)
    - `/update` or `/u` - This comment will update the PR with the latest changes from the target branch. Unless there is a merge conflict or it is a draft PR. NOTE: this only updates the PR once, so if you need to update again, you need to call the command again.

@smoya
Copy link
Member

smoya commented Aug 25, 2024

Why would you open a new PR for adding tests instead of adding those in #1122?
I would close this and move the tests to the proper PR

Copy link

sonarqubecloud bot commented Sep 9, 2024

@helios2003
Copy link
Contributor Author

Closing this PR in favor of the suggestion made by @smoya in this comment here: #1130 (comment). The contents of this PR can be found in the main PR i.e. #1122

@helios2003 helios2003 closed this Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants