Skip to content

Add tests for variant analysis history item#1650

Merged
elenatanasoiu merged 12 commits intomainfrom
nora-elena/integration-tests
Oct 31, 2022
Merged

Add tests for variant analysis history item#1650
elenatanasoiu merged 12 commits intomainfrom
nora-elena/integration-tests

Conversation

@norascheuch
Copy link
Copy Markdown
Contributor

@norascheuch norascheuch commented Oct 24, 2022

🚨 Please review this PR commit-by-commit.

We're repeating what we've done for the RemoteQueryHistoryItem tests for now.

Separately we'll think about setting up tests that check for both remote queries and variant analysis in the query history.

At the moment we'd like to focus on just adding some test coverage for VariantAnalysisHistoryItem.

Checklist

  • CHANGELOG.md has been updated to incorporate all user visible changes made by this pull request.
  • Issues have been created for any UI or other user-facing changes made by this pull request.
  • [Maintainers only] If this pull request makes user-facing changes that require documentation changes, open a corresponding docs pull request in the github/codeql repo and add the ready-for-doc-review label there.

@norascheuch norascheuch force-pushed the nora-elena/integration-tests branch from e64a7fb to 769916e Compare October 25, 2022 07:48
@elenatanasoiu elenatanasoiu force-pushed the nora-elena/integration-tests branch 2 times, most recently from c180176 to 8e84ddb Compare October 25, 2022 12:11
@norascheuch norascheuch force-pushed the nora-elena/integration-tests branch from 0b7ccfd to e4f3b56 Compare October 25, 2022 13:45
@elenatanasoiu elenatanasoiu force-pushed the nora-elena/integration-tests branch 2 times, most recently from be9acef to 5427260 Compare October 25, 2022 18:26
@elenatanasoiu elenatanasoiu changed the title WIP Create Multi Variant Analysis Integration Test Add tests for variant analysis history item Oct 25, 2022
@elenatanasoiu elenatanasoiu force-pushed the nora-elena/integration-tests branch from 5427260 to 0ed063e Compare October 25, 2022 18:29
@elenatanasoiu
Copy link
Copy Markdown
Contributor

elenatanasoiu commented Oct 25, 2022

norascheuch and others added 8 commits October 26, 2022 15:52
We will need to set up some VariantAnalysisHistoryItem types in order
to use them in our tests.

We're repeating what we've done for RemoteQueryHistoryItem for now.

Separately we'll think about setting up tests that check for both
remote queries and variant analysis in the query history.

At the moment we'd like to focus on just adding some test coverage
for variant analysis history items.

Co-authored-by: Nora Scheuch <norascheuch@github.com>
Co-authored-by: Nora Scheuch <norascheuch@github.com>
Co-authored-by: Nora Scheuch <norascheuch@github.com>
@elenatanasoiu elenatanasoiu force-pushed the nora-elena/integration-tests branch from 7314c4d to 9c22ed6 Compare October 26, 2022 14:52
@shati-patel shati-patel reopened this Oct 26, 2022
@shati-patel
Copy link
Copy Markdown
Contributor

(just closed and re-opened in an attempt to kick off PR checks!)

We've merged #1656
which actually implements item removal. We'll need to change our
tests to account for this.

We've also merged #1654
which implements opening the view when we click on a variant analysis
history item. So we've changed our tests to take into account that
there's now a `showView` method being called.
@elenatanasoiu elenatanasoiu force-pushed the nora-elena/integration-tests branch from 9c22ed6 to ad7a04e Compare October 26, 2022 15:54
@elenatanasoiu elenatanasoiu marked this pull request as ready for review October 28, 2022 08:38
@elenatanasoiu elenatanasoiu requested a review from a team as a code owner October 28, 2022 08:38
Copy link
Copy Markdown
Member

@koesie10 koesie10 left a comment

Choose a reason for hiding this comment

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

LGTM, I have some small improvement suggestions but this will definitely increase our test coverage

Comment on lines +130 to +136
expect(rehydrateVariantAnalysisStub).to.have.callCount(2);

expect(rehydrateVariantAnalysisStub.getCall(0).args[0]).to.deep.eq(rawQueryHistory[0].variantAnalysis);
expect(rehydrateVariantAnalysisStub.getCall(0).args[1]).to.deep.eq(rawQueryHistory[0].status);

expect(rehydrateVariantAnalysisStub.getCall(1).args[0]).to.deep.eq(rawQueryHistory[1].variantAnalysis);
expect(rehydrateVariantAnalysisStub.getCall(1).args[1]).to.deep.eq(rawQueryHistory[1].status);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

These seem like they are testing the rehydration, rather than the removal. Can we remove these and expect that they are tested by the test above?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yeah they are kinda redundant. I've removed the extra checks.

Comment on lines +143 to +144
expect(removeVariantAnalysisStub).to.have.callCount(1);
expect(rehydrateVariantAnalysisStub).to.have.callCount(2);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Perhaps we can reset these stubs and check that they have call count 0? That would be more resilient to changes.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We call sandbox.restore() in the beforeEach() block, so the count is reset for each of the tests.

I've double checked this by adding these lines at the top of this test:

    expect(removeVariantAnalysisStub).to.have.callCount(0);
    expect(rehydrateVariantAnalysisStub).to.have.callCount(0);

They passed, which indicates the count starts from zero.

@elenatanasoiu elenatanasoiu merged commit c36ce48 into main Oct 31, 2022
@elenatanasoiu elenatanasoiu deleted the nora-elena/integration-tests branch October 31, 2022 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants