Add tests for variant analysis history item#1650
Conversation
e64a7fb to
769916e
Compare
c180176 to
8e84ddb
Compare
0b7ccfd to
e4f3b56
Compare
be9acef to
5427260
Compare
5427260 to
0ed063e
Compare
|
Depends on these PRs getting merged in first: |
0ed063e to
7314c4d
Compare
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>
7314c4d to
9c22ed6
Compare
|
(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.
9c22ed6 to
ad7a04e
Compare
koesie10
left a comment
There was a problem hiding this comment.
LGTM, I have some small improvement suggestions but this will definitely increase our test coverage
| 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); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Yeah they are kinda redundant. I've removed the extra checks.
| expect(removeVariantAnalysisStub).to.have.callCount(1); | ||
| expect(rehydrateVariantAnalysisStub).to.have.callCount(2); |
There was a problem hiding this comment.
Perhaps we can reset these stubs and check that they have call count 0? That would be more resilient to changes.
There was a problem hiding this comment.
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.
🚨 Please review this PR commit-by-commit.
We're repeating what we've done for the
RemoteQueryHistoryItemtests 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
ready-for-doc-reviewlabel there.