-
Notifications
You must be signed in to change notification settings - Fork 76
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
OCLOMRS-1053: Concept number mismatch between concept list and dictionary view #754
Conversation
@ibacher kindly take a look when possible. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@merovingienne Thanks for this! Looks great! Just a few small adjustments and I think this should be good to merge in.
Co-authored-by: Ian <52504170+ibacher@users.noreply.github.com>
e14545a
to
6acf41e
Compare
@merovingienne Playing around with this, I see it's generating an excessive number of requests to get the size of the concepts that seems to be why it's breaking the e2e test. Would you be able to have a look at that? |
@ibacher Sure, I'll check why this is happening and what we can do about it. At first I was wondering if this was a random failure, but with two occurrences that seems unlikely. |
@ibacher This has been a veritable rabbit hole. I found a couple of issues. Tl;dr - Fixing the first problem caused some existing tests to fail.
Once these two were fixed, it seems some tests that unknowingly depended on the remount behaviour are now broken. For future reference (mostly for myself): Previously, loading profile data caused component remounts. This allowed Formik forms down the hierarchy to remount, initialising them with proper values from API calls. But without the remounts, the forms were initialised with empty values while fetching relevant data. This caused errors as Formik doesn't reinitialise by default, when the initial values variable changes. eg: Edit Org privacy test Fixed this by delaying Org Edit form render until org details are fetched. Have a couple more tests to fix. Will inform once done. |
cc @merovingienne , Is this a blocker? |
@sherrif10 I'm debugging the tests currently. If I'm not mistaken, in the Add Concepts to Dictionary test group, the last 3 cases (tests 2-4) cannot succeed as they require a dictionary to exist first, but we are not enforcing that requirement in the tests. @ibacher could you kindly confirm this? I'm testing now with a dictionary first created before the body of these tests. There's an API call failure as well (retrieveConcepts API call - URL excluding added concepts throws an HTTP 500). Any help/tips would be appreciated! |
Update: The retrieveConcepts API call succeeds when pointing to the OCL QA server. This means the dockerised server used for testing has a bug. I just saw that there's an updated image. Will test with that and update. |
@@ -14,7 +14,8 @@ Feature: Add concepts to an existing dictionary | |||
@dictionary | |||
@ciel | |||
Scenario: The user should be able to add a single concept from their preferred source | |||
Given the user is on the "Import existing concept" page | |||
Given a dictionary exists |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there any good way how we can refactor these scenarios, Especially scenarios which look the same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually think this is fine. In general, I'm happy with the feature files being a little repetitive, as each feature should uniquely describe the steps it takes to use that feature, even if they are obvious or done everywhere.
Yes, that seems to be the case. Sorry for the difficulty! |
I've fixed the integration tests now. Two unit tests are still giving me trouble though. Essentially, they need to wait until the page loads according to the defined API call sequence (component load state changes). @ibacher I think it's time I seek your help. Could you kindly take a look at it? |
@ibacher I've fixed the unit test failure by not delaying the content render in the View Concepts page. This (hopefully) allows us to close this ticket. I'd feel better if you could read through the logic in that file and see if it's comprehensible. I'm worried if the component state machine is confusing. |
Ping @suruchee, any thoughts/concerns on this? |
JIRA TICKET NAME:
OCLOMRS-1053: Concept number mismatch between concept list and dictionary view
Summary:
The number of total concepts shown in the dictionary view page does not match with the number in the concept list page.