-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
[DataEntryTable] Use current analysis lang with sense glosses #3239
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3239 +/- ##
==========================================
- Coverage 74.84% 74.76% -0.08%
==========================================
Files 277 277
Lines 10641 10652 +11
Branches 1279 1283 +4
==========================================
Hits 7964 7964
- Misses 2314 2321 +7
- Partials 363 367 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
Reviewed 5 of 6 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @imnasnainaec)
src/components/DataEntry/DataEntryTable/index.tsx
line 164 at r2 (raw file):
let glossIndex = sense.glosses.findIndex((g) => g.language === analysisLang); if (glossIndex === -1) { glossIndex = 0;
Should this actually be an error?
src/components/DataEntry/DataEntryTable/tests/index.test.tsx
line 263 at r2 (raw file):
expectedWord.senses[senseIndex] = { ...sense, glosses: [expectedGloss] }; expect(updateEntryGloss(entry, def, mockSemDom.id, "")).toEqual(
I don't like this being an empty string. There is a code smell here, if we always expect it to be set in the real data having an empty string in the test data feels like a chance for a problem to sneak through in the future.
Code quote:
""
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.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @imnasnainaec)
src/components/DataEntry/DataEntryTable/index.tsx
line 164 at r2 (raw file):
Previously, jasonleenaylor (Jason Naylor) wrote…
Should this actually be an error?
No, because this parallels how we picked the gloss in the first place. The sense might not have a gloss in the current language, in which case we picked the first gloss. I'll evaluate whether there's a more connected way to do this, or at least add a comment.
src/components/DataEntry/DataEntryTable/tests/index.test.tsx
line 263 at r2 (raw file):
Previously, jasonleenaylor (Jason Naylor) wrote…
I don't like this being an empty string. There is a code smell here, if we always expect it to be set in the real data having an empty string in the test data feels like a chance for a problem to sneak through in the future.
Fair. I'll work on it.
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.
Reviewed 2 of 2 files at r3, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @imnasnainaec)
Resolves #3167
Acceptance test:
This change is