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

Adds unit tests for CounterBadge #28867

Conversation

procload
Copy link
Contributor

New Behavior

Adds tests for CounterBadge

@fabricteam
Copy link
Collaborator

fabricteam commented Aug 15, 2023

🕵 fluentui-web-components-v3 No visual regressions between this PR and main

@fabricteam
Copy link
Collaborator

fabricteam commented Aug 15, 2023

📊 Bundle size report

🤖 This report was generated against 2c97f929d3fd505f65f4094a4f45fbc008eb2b9d

@size-auditor
Copy link

size-auditor bot commented Aug 15, 2023

Asset size changes

Size Auditor did not detect a change in bundle size for any component!

Baseline commit: 2c97f929d3fd505f65f4094a4f45fbc008eb2b9d (build)

@codesandbox-ci
Copy link

codesandbox-ci bot commented Aug 15, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 8aca87f:

Sandbox Source
@fluentui/react 8 starter Configuration
@fluentui/react-components 9 starter Configuration

@procload procload enabled auto-merge (squash) August 17, 2023 18:25
Copy link
Member

@miroslavstastny miroslavstastny left a comment

Choose a reason for hiding this comment

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

Multiple flaky tests are reported:

8 flaky
    [chromium] › src/counter-badge/counter-badge.spec.ts:73:3 › CounterBadge component › should show 0 when showZero is set programmatically 
    [chromium] › src/counter-badge/counter-badge.spec.ts:89:3 › CounterBadge component › should not show 0 when showZero is set programmatically 
    [chromium] › src/counter-badge/counter-badge.spec.ts:121:3 › CounterBadge component › should show and hide dot programmatically 
    [firefox] › src/counter-badge/counter-badge.spec.ts:73:3 › CounterBadge component › should show 0 when showZero is set programmatically 
    [firefox] › src/counter-badge/counter-badge.spec.ts:89:3 › CounterBadge component › should not show 0 when showZero is set programmatically 
    [firefox] › src/counter-badge/counter-badge.spec.ts:121:3 › CounterBadge component › should show and hide dot programmatically 
    [webkit] › src/counter-badge/counter-badge.spec.ts:73:3 › CounterBadge component › should show 0 when showZero is set programmatically 
    [webkit] › src/counter-badge/counter-badge.spec.ts:89:3 › CounterBadge component › should not show 0 when showZero is set programmatically 

@@ -96,6 +94,7 @@ test.describe('CounterBadge component', () => {

const shadowContent = await page.evaluate(() => {
const element = document.querySelector('fluent-counter-badge');
console.log(element);
Copy link
Member

Choose a reason for hiding this comment

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

remove the console.log()

@miroslavstastny
Copy link
Member

miroslavstastny commented Aug 23, 2023

I still see flaky tests:

  2 flaky
    [chromium] › src/counter-badge/counter-badge.spec.ts:120:3 › CounterBadge component › should show and hide dot programmatically 
    [firefox] › src/counter-badge/counter-badge.spec.ts:120:3 › CounterBadge component › should show and hide dot programmatically 

Edit: another run:

 3 flaky
    [chromium] › src/counter-badge/counter-badge.spec.ts:71:3 › CounterBadge component › should show 0 when showZero is set programmatically 
    [webkit] › src/counter-badge/counter-badge.spec.ts:120:3 › CounterBadge component › should show and hide dot programmatically 

@miroslavstastny
Copy link
Member

Still red:

  2 failed
    [firefox] › src/counter-badge/counter-badge.spec.ts:115:3 › CounterBadge component › should hide dot programmatically 
    [webkit] › src/counter-badge/counter-badge.spec.ts:115:3 › CounterBadge component › should hide dot programmatically 
  2 flaky
    [chromium] › src/counter-badge/counter-badge.spec.ts:71:3 › CounterBadge component › should show 0 when showZero is set programmatically 
    [firefox] › src/counter-badge/counter-badge.spec.ts:71:3 › CounterBadge component › should show 0 when showZero is set programmatically 

@@ -26,7 +26,7 @@ module.exports = /** @type {Omit<import('../../../.storybook/main').StorybookCon
backgrounds: false,
viewport: false,
toolbars: false,
actions: false,
Copy link
Member

Choose a reason for hiding this comment

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

Is this intentional or just a debugging left over?

@miroslavstastny miroslavstastny merged commit e414e26 into microsoft:web-components-v3 Aug 26, 2023
24 checks passed
chrisdholt pushed a commit that referenced this pull request Apr 29, 2024
* Adds tests for counterBadge

* Removes tests for slotted icon content

* Adds tests to verify if showZero and dot are able to be set programmatically

* Fixes linting errors

* Changes beforeAll to beforeEach to fix flaky tests

* Removes .only

* Tries to unflake

* Adds fixes for flaky tests

* Updates tests without shadowContent query
radium-v pushed a commit to radium-v/fluentui that referenced this pull request Apr 29, 2024
* Adds tests for counterBadge

* Removes tests for slotted icon content

* Adds tests to verify if showZero and dot are able to be set programmatically

* Fixes linting errors

* Changes beforeAll to beforeEach to fix flaky tests

* Removes .only

* Tries to unflake

* Adds fixes for flaky tests

* Updates tests without shadowContent query
radium-v pushed a commit to radium-v/fluentui that referenced this pull request Apr 29, 2024
* Adds tests for counterBadge

* Removes tests for slotted icon content

* Adds tests to verify if showZero and dot are able to be set programmatically

* Fixes linting errors

* Changes beforeAll to beforeEach to fix flaky tests

* Removes .only

* Tries to unflake

* Adds fixes for flaky tests

* Updates tests without shadowContent query
radium-v pushed a commit to radium-v/fluentui that referenced this pull request Apr 30, 2024
* Adds tests for counterBadge

* Removes tests for slotted icon content

* Adds tests to verify if showZero and dot are able to be set programmatically

* Fixes linting errors

* Changes beforeAll to beforeEach to fix flaky tests

* Removes .only

* Tries to unflake

* Adds fixes for flaky tests

* Updates tests without shadowContent query
radium-v pushed a commit that referenced this pull request Apr 30, 2024
* Adds tests for counterBadge

* Removes tests for slotted icon content

* Adds tests to verify if showZero and dot are able to be set programmatically

* Fixes linting errors

* Changes beforeAll to beforeEach to fix flaky tests

* Removes .only

* Tries to unflake

* Adds fixes for flaky tests

* Updates tests without shadowContent query
radium-v pushed a commit that referenced this pull request May 2, 2024
* Adds tests for counterBadge

* Removes tests for slotted icon content

* Adds tests to verify if showZero and dot are able to be set programmatically

* Fixes linting errors

* Changes beforeAll to beforeEach to fix flaky tests

* Removes .only

* Tries to unflake

* Adds fixes for flaky tests

* Updates tests without shadowContent query
radium-v pushed a commit that referenced this pull request May 2, 2024
* Adds tests for counterBadge

* Removes tests for slotted icon content

* Adds tests to verify if showZero and dot are able to be set programmatically

* Fixes linting errors

* Changes beforeAll to beforeEach to fix flaky tests

* Removes .only

* Tries to unflake

* Adds fixes for flaky tests

* Updates tests without shadowContent query
radium-v pushed a commit that referenced this pull request May 2, 2024
* Adds tests for counterBadge

* Removes tests for slotted icon content

* Adds tests to verify if showZero and dot are able to be set programmatically

* Fixes linting errors

* Changes beforeAll to beforeEach to fix flaky tests

* Removes .only

* Tries to unflake

* Adds fixes for flaky tests

* Updates tests without shadowContent query
radium-v pushed a commit that referenced this pull request May 3, 2024
* Adds tests for counterBadge

* Removes tests for slotted icon content

* Adds tests to verify if showZero and dot are able to be set programmatically

* Fixes linting errors

* Changes beforeAll to beforeEach to fix flaky tests

* Removes .only

* Tries to unflake

* Adds fixes for flaky tests

* Updates tests without shadowContent query
radium-v pushed a commit that referenced this pull request May 6, 2024
* Adds tests for counterBadge

* Removes tests for slotted icon content

* Adds tests to verify if showZero and dot are able to be set programmatically

* Fixes linting errors

* Changes beforeAll to beforeEach to fix flaky tests

* Removes .only

* Tries to unflake

* Adds fixes for flaky tests

* Updates tests without shadowContent query
radium-v pushed a commit that referenced this pull request May 6, 2024
* Adds tests for counterBadge

* Removes tests for slotted icon content

* Adds tests to verify if showZero and dot are able to be set programmatically

* Fixes linting errors

* Changes beforeAll to beforeEach to fix flaky tests

* Removes .only

* Tries to unflake

* Adds fixes for flaky tests

* Updates tests without shadowContent query
radium-v pushed a commit that referenced this pull request May 8, 2024
* Adds tests for counterBadge

* Removes tests for slotted icon content

* Adds tests to verify if showZero and dot are able to be set programmatically

* Fixes linting errors

* Changes beforeAll to beforeEach to fix flaky tests

* Removes .only

* Tries to unflake

* Adds fixes for flaky tests

* Updates tests without shadowContent query
radium-v pushed a commit that referenced this pull request May 10, 2024
* Adds tests for counterBadge

* Removes tests for slotted icon content

* Adds tests to verify if showZero and dot are able to be set programmatically

* Fixes linting errors

* Changes beforeAll to beforeEach to fix flaky tests

* Removes .only

* Tries to unflake

* Adds fixes for flaky tests

* Updates tests without shadowContent query
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.

None yet

5 participants