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(SkipContent): improve failing test #3658

Merged
merged 1 commit into from
Jun 5, 2024

Conversation

langz
Copy link
Contributor

@langz langz commented Jun 5, 2024

This is just a first attempt, where I've moved the expect statements inside of the waitForU(seems to be a recurring pattern in SkipContent.text.tsx), not sure if it's fixing anything yet.

Why do I suggest this change?

I've opened two PRs(#3656 & #3653), both builds(3656 & 3653) failing with:

FAIL src/components/skip-content/__tests__/SkipContent.test.tsx
  ● SkipContent.Return › should show button and set focus on content element

    expect(element).not.toBeInTheDocument()

    expected document not to contain element, found <button class="dnb-button dnb-button--secondary dnb-button--has-text dnb-button--wrap" type="button"><span aria-hidden="true" class="dnb-button__alignment">‌</span><span class="dnb-button__text dnb-skeleton--show-font">Aria</span></button> instead

      218 |       expect(document.activeElement.tagName).toBe('SECTION')
      219 |     })
    > 220 |     expect(element.querySelector('.dnb-button')).not.toBeInTheDocument()
          |                                                      ^
      221 |     expect(document.activeElement.classList).toContain(
      222 |       'dnb-skip-content__focus'
      223 |     )

      at Object.toBeInTheDocument (src/components/skip-content/__tests__/SkipContent.test.tsx:220:54)

Copy link

vercel bot commented Jun 5, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
eufemia ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 5, 2024 9:04am

Copy link
Contributor

@joakbjerk joakbjerk left a comment

Choose a reason for hiding this comment

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

Seems to have fixed the issue? 😄

@langz langz merged commit 41794c3 into main Jun 5, 2024
14 checks passed
@langz langz deleted the chore/improve-failing-skip-content-return-test branch June 5, 2024 12:00
@tujoworker
Copy link
Member

🎉 This PR is included in version 10.35.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

3 participants