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

Conformance tests for triggers #21670

Open
layershifter opened this issue Feb 9, 2022 · 6 comments
Open

Conformance tests for triggers #21670

layershifter opened this issue Feb 9, 2022 · 6 comments
Assignees

Comments

@layershifter
Copy link
Member

layershifter commented Feb 9, 2022

Recently we had various discussions around triggers and reached the agreement on how it should work:

  • No magic handling of props in triggers, props should be applied always. I.e consistently set the same attributes and props
  • child.props always win, it is user's responsibility to handle it
    • The exclusion from the rule are callbacks, they are merged

Another point that we could cover that contract with conformance tests and enable them for components that use the trigger pattern. For an initial implementation the following scenarios should be covered.

Props merging

Props specified by a customer always win.

function App() {
  return (
    <Trigger>
      <button id="foo" aria-label="bar" />
    </Trigger>
  );
}

This should render following markup:

<button id="foo" aria-label="bar"></button>

Callback merging

Internal and user's callbacks should be merged.

function App() {
  return (
    <Trigger>
      <button onClick={() => console.log('foo') />
    </Trigger>
  );
}
  • internal onClick handler in Trigger should be called if present
  • onClick specified by user should be also called
@miroslavstastny
Copy link
Member

This is needed as there are tests which are already copy&paste.

@bsunderhus bsunderhus mentioned this issue Aug 4, 2022
33 tasks
@msft-fluent-ui-bot
Copy link
Collaborator

Because this issue has not had activity for over 150 days, we're automatically closing it for house-keeping purposes.

Still require assistance? Please, create a new issue with up-to date details.

@msft-fluent-ui-bot msft-fluent-ui-bot added the Resolution: Soft Close Soft closing inactive issues over a certain period label Jan 1, 2023
@layershifter layershifter reopened this Jan 3, 2023
@layershifter layershifter removed the Resolution: Soft Close Soft closing inactive issues over a certain period label Jan 3, 2023
@msft-fluent-ui-bot
Copy link
Collaborator

Because this issue has not had activity for over 150 days, we're automatically closing it for house-keeping purposes.

Still require assistance? Please, create a new issue with up-to date details.

@msft-fluent-ui-bot msft-fluent-ui-bot added the Resolution: Soft Close Soft closing inactive issues over a certain period label Jun 2, 2023
@layershifter layershifter reopened this Jun 2, 2023
@layershifter layershifter removed the Resolution: Soft Close Soft closing inactive issues over a certain period label Jun 2, 2023
@microsoft-github-policy-service

Because this issue has not had activity for over 150 days, we're automatically closing it for house-keeping purposes.

Still require assistance? Please, create a new issue with up-to date details.

@microsoft-github-policy-service microsoft-github-policy-service bot added the Resolution: Soft Close Soft closing inactive issues over a certain period label Oct 30, 2023
@layershifter layershifter reopened this Oct 30, 2023
@layershifter layershifter removed the Resolution: Soft Close Soft closing inactive issues over a certain period label Oct 30, 2023

Because this issue has not had activity for over 150 days, we're automatically closing it for house-keeping purposes.

Still require assistance? Please, create a new issue with up-to date details.

@microsoft-github-policy-service microsoft-github-policy-service bot added the Resolution: Soft Close Soft closing inactive issues over a certain period label Mar 28, 2024
@layershifter layershifter reopened this Mar 28, 2024

This issue has not had activity for over 180 days! We're adding Soft close label and will close it soon for house-keeping purposes.
Still require assistance? Please add comment - "keep open".

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

No branches or pull requests

4 participants