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

[CharInv] Track words changed with find-and-replace #2955

Merged
merged 23 commits into from
Mar 28, 2024

Conversation

imnasnainaec
Copy link
Collaborator

@imnasnainaec imnasnainaec commented Feb 19, 2024

Follows #2964
Resolves #2333

Also, fixed a bug in #2962 that the CancelConfirmDialog gets stuck in loading after its first use.


This change is Reviewable

@imnasnainaec imnasnainaec self-assigned this Feb 19, 2024
@imnasnainaec imnasnainaec changed the title Track words changes with find-and-replace Track words changed with find-and-replace Feb 19, 2024
Copy link

codecov bot commented Feb 19, 2024

Codecov Report

Attention: Patch coverage is 98.09524% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 73.50%. Comparing base (3c646a2) to head (8653a83).

Files Patch % Lines
src/goals/CharacterInventory/CharInvCompleted.tsx 95.23% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2955      +/-   ##
==========================================
+ Coverage   72.84%   73.50%   +0.65%     
==========================================
  Files         265      265              
  Lines       10217    10300      +83     
  Branches     1201     1213      +12     
==========================================
+ Hits         7443     7571     +128     
+ Misses       2418     2374      -44     
+ Partials      356      355       -1     
Flag Coverage Δ
backend 82.92% <100.00%> (+0.21%) ⬆️
frontend 64.76% <97.01%> (+1.07%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@imnasnainaec imnasnainaec marked this pull request as ready for review February 19, 2024 22:53
@imnasnainaec imnasnainaec marked this pull request as draft February 21, 2024 15:44
@imnasnainaec imnasnainaec changed the title Track words changed with find-and-replace [CharInv] Track words changed with find-and-replace Feb 23, 2024
@imnasnainaec imnasnainaec marked this pull request as ready for review March 21, 2024 21:15
@imnasnainaec imnasnainaec marked this pull request as draft March 26, 2024 13:48
@imnasnainaec imnasnainaec marked this pull request as ready for review March 26, 2024 15:09
Copy link
Collaborator

@jmgrady jmgrady left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 16 files at r2, 15 of 19 files at r3, 8 of 8 files at r4, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @imnasnainaec)


public/locales/en/translation.json line 374 at r4 (raw file):

      "noWordChanges": "No words changed by find-and-replace.",
      "wordChanges": "Words changed by find-and-replace:",
      "wordChangesWithStrings": "Words changed by find-and-replace ({{ val1 }} → {{ val2 }}):"

A little wordy. Why not just "Words changed"?

Code quote:

      "noWordChanges": "No words changed by find-and-replace.",
      "wordChanges": "Words changed by find-and-replace:",
      "wordChangesWithStrings": "Words changed by find-and-replace ({{ val1 }} → {{ val2 }}):"

src/goals/CharacterInventory/Redux/tests/CharacterInventoryActions.test.tsx line 230 at r4 (raw file):

      mockGetFrontierWords.mockResolvedValue([]);

      await store.dispatch(findAndReplace("A", "a"));

I think this test would be more convincing if there was a word in the Frontier with no A in it.


src/goals/CharacterInventory/tests/CharInvCompleted.test.tsx line 110 at r4 (raw file):

      root.findByProps({ id: CharInvCompletedId.TypographyNoWordChanges })
    ).toThrow();
    root.findByProps({ id: CharInvCompletedId.TypographyWordChanges });

Shouldn't there be an expect after calling findByProps? Am I missing something?

Code quote:

root.findByProps

src/goals/CharacterInventory/tests/CharInvCompleted.test.tsx line 145 at r4 (raw file):

    });
    expect(root.findAllByType(CharChange)).toHaveLength(2);
  });

Why does passing a list of 3 character changes expects the length to be 3 but when a list of 6 is passed the expected value is 2?

Code quote:

  it("doesn't render more than 3 char changes", async () => {
    await renderCharInvChangesGoalList({
      ...defaultCharInvChanges,
      charChanges: mockCharChanges,
    });
    expect(root.findAllByType(CharChange)).toHaveLength(2);
  });

Copy link
Collaborator Author

@imnasnainaec imnasnainaec left a comment

Choose a reason for hiding this comment

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

Reviewable status: 16 of 22 files reviewed, 2 unresolved discussions (waiting on @jmgrady)


src/goals/CharacterInventory/tests/CharInvCompleted.test.tsx line 110 at r4 (raw file):

Previously, jmgrady (Jim Grady) wrote…

Shouldn't there be an expect after calling findByProps? Am I missing something?

It will throw if it fails. I could add expect(() => ...).not.toThrow(); if you think that helps.


src/goals/CharacterInventory/tests/CharInvCompleted.test.tsx line 145 at r4 (raw file):

Previously, jmgrady (Jim Grady) wrote…

Why does passing a list of 3 character changes expects the length to be 3 but when a list of 6 is passed the expected value is 2?

Clarifying comment added.

Copy link
Collaborator

@jmgrady jmgrady left a comment

Choose a reason for hiding this comment

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

Reviewed 6 of 6 files at r5, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @imnasnainaec)


src/goals/CharacterInventory/tests/CharInvCompleted.test.tsx line 110 at r4 (raw file):

Previously, imnasnainaec (D. Ror.) wrote…

It will throw if it fails. I could add expect(() => ...).not.toThrow(); if you think that helps.

A comment could help but I am fine with that explanation.

Copy link
Collaborator

@jmgrady jmgrady left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @imnasnainaec)

@imnasnainaec imnasnainaec merged commit e9b7d72 into master Mar 28, 2024
17 checks passed
@imnasnainaec imnasnainaec deleted the char-inv-changes branch March 28, 2024 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create Character Inventory does not show all changes in history
2 participants