Skip to content

Conversation

@ChristopherChudzicki
Copy link
Contributor

What are the relevant tickets?

followup to fix a flaky test in #1473

Description (What does it do?)

Makes all tests in ChannelPage.test.tsx specific to relevant types of channels.

How can this be tested?

Tests should pass

Copy link
Contributor Author

@ChristopherChudzicki ChristopherChudzicki Aug 29, 2024

Choose a reason for hiding this comment

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

A test that was meant only for non-unit channels was running ~25% of the time for unit channels, too.

This PR resolves that.

Before:

describe("ChannelPage", () => {
    test.each(NON_UNIT_CHANNEL_TYPES)("test some non unit stuff", ()=>{})
    test("some stuff for all channels", () => {})
    test("some stuff for a specific channel type declared in test", () => {})
    // ...
})

describe("Unit ChannelPage", () => {
  test.each(NON_UNIT_CHANNEL_TYPES)("test some non unit stuff", ()=>{})
  test("some stuff for all channels", () => {})
  test("some stuff for a specific channel type declared in test", () => {})
  // ...
})

Now:

describe.each(ALL_CHANNEL_TYPES)("ChannelPage, common behavior ($channelType)", ...)
describe.each(NON_UNIT_CHANNEL_TYPES)("ChannelPage, common non-unit behavior ($channelType)", ...)
describe("ChannelPage, unit only", ...)

@ChristopherChudzicki ChristopherChudzicki added the Needs Review An open Pull Request that is ready for review label Aug 29, 2024
@gumaerc gumaerc self-assigned this Aug 29, 2024
@ChristopherChudzicki ChristopherChudzicki changed the title Cc/fix a test Fix a flaky test Aug 29, 2024
Copy link
Contributor

@gumaerc gumaerc left a comment

Choose a reason for hiding this comment

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

👍

@ChristopherChudzicki ChristopherChudzicki marked this pull request as ready for review August 29, 2024 21:07
@ChristopherChudzicki ChristopherChudzicki merged commit 30aceb4 into main Aug 29, 2024
@odlbot odlbot mentioned this pull request Aug 30, 2024
4 tasks
@rhysyngsun rhysyngsun deleted the cc/fix-a-test branch February 7, 2025 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Review An open Pull Request that is ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants