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

Flaky and false positive tests on EditDataModelBindings #11893

Closed
TomasEng opened this issue Dec 19, 2023 · 1 comment · Fixed by #12006
Closed

Flaky and false positive tests on EditDataModelBindings #11893

TomasEng opened this issue Dec 19, 2023 · 1 comment · Fixed by #12006
Labels
added-to-sprint kind/bug Used when there is a defect / something is not working as it should. quality/code Violations from current rules for code, best practices, etc. Or just bad code. quality/debt Shortcuts made for saving time. Fixing this will make us more efficient going forward. quality/testing Tests that are missing, needs to be created or could be improved. status/ready-for-specification Status: Used for issues that are ready for functional decription og detailed design.

Comments

@TomasEng
Copy link
Contributor

TomasEng commented Dec 19, 2023

There are several issues with the unit tests on the EditDataModelBindings component:

  • In several places, the expect methods are not called, causing false positives.
    Code like expect(something).toHaveBeenCalled should be replaced by expect(something).toHaveBeenCalled(). However, this will cause at least one of the tests to fail, indicating that there is a bug, so this should also be investigated.
  • The tests are flaky because of the way user events are fired. A UserEvent object should be set up first using userEvent.setup() and the events should be fired using act instead of waitFor: await act(() => user.click(element));
  • The deprecated toBeCalled method needs to be replaced with toHaveBeenCalled.
@TomasEng TomasEng added kind/bug Used when there is a defect / something is not working as it should. quality/testing Tests that are missing, needs to be created or could be improved. area/test quality/code Violations from current rules for code, best practices, etc. Or just bad code. quality/debt Shortcuts made for saving time. Fixing this will make us more efficient going forward. status/ready-for-specification Status: Used for issues that are ready for functional decription og detailed design. labels Dec 19, 2023
@mlqn
Copy link
Contributor

mlqn commented Dec 19, 2023

#11857 should fix issues 1 and 3

@ghost ghost self-assigned this Jan 11, 2024
@ghost ghost added the added-to-sprint label Jan 11, 2024
@ghost ghost mentioned this issue Jan 11, 2024
3 tasks
@ghost ghost linked a pull request Jan 11, 2024 that will close this issue
3 tasks
@ghost ghost removed their assignment Jan 11, 2024
@lassopicasso lassopicasso assigned lassopicasso and ghost and unassigned lassopicasso Jan 12, 2024
@ghost ghost removed their assignment Jan 12, 2024
@ghost ghost closed this as completed in #12006 Jan 12, 2024
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
added-to-sprint kind/bug Used when there is a defect / something is not working as it should. quality/code Violations from current rules for code, best practices, etc. Or just bad code. quality/debt Shortcuts made for saving time. Fixing this will make us more efficient going forward. quality/testing Tests that are missing, needs to be created or could be improved. status/ready-for-specification Status: Used for issues that are ready for functional decription og detailed design.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants