|
1 | 1 | import { expect } from 'chai'; |
2 | 2 |
|
3 | 3 | import { QueryStatus } from '../../src/query-status'; |
4 | | -import { getQueryHistoryItemId, getRawQueryName } from '../../src/query-history-info'; |
| 4 | +import { getQueryHistoryItemId, getQueryText, getRawQueryName } from '../../src/query-history-info'; |
5 | 5 | import { VariantAnalysisHistoryItem } from '../../src/remote-queries/variant-analysis-history-item'; |
6 | 6 | import { createMockVariantAnalysis } from '../../src/vscode-tests/factories/remote-queries/shared/variant-analysis'; |
7 | 7 | import { createMockLocalQueryInfo } from '../../src/vscode-tests/factories/local-queries/local-query-history-item'; |
@@ -60,4 +60,24 @@ describe('Query history info', () => { |
60 | 60 | expect(historyItemId).to.equal(variantAnalysisHistoryItem.historyItemId); |
61 | 61 | }); |
62 | 62 | }); |
| 63 | + |
| 64 | + describe('getQueryText', () => { |
| 65 | + it('should get the query text for local history items', () => { |
| 66 | + const queryText = getQueryText(localQueryHistoryItem); |
| 67 | + |
| 68 | + expect(queryText).to.equal(localQueryHistoryItem.initialInfo.queryText); |
| 69 | + }); |
| 70 | + |
| 71 | + it('should get the query text for remote query history items', () => { |
| 72 | + const queryText = getQueryText(remoteQueryHistoryItem); |
| 73 | + |
| 74 | + expect(queryText).to.equal(remoteQueryHistoryItem.remoteQuery.queryText); |
| 75 | + }); |
| 76 | + |
| 77 | + it('should get the query text for variant analysis history items', () => { |
| 78 | + const queryText = getQueryText(variantAnalysisHistoryItem); |
| 79 | + |
| 80 | + expect(queryText).to.equal(variantAnalysisHistoryItem.variantAnalysis.query.text); |
| 81 | + }); |
| 82 | + }); |
63 | 83 | }); |
0 commit comments