Move query-history-info tests next to query-history tests

We've introduced a new `local-query-history-item.ts` factory method [1]
which includes a cancellation token. The factory will need to import the
CancellationTokenSource from `vscode`.

We already had a factory method but it didn't quite map with the setup
we needed. For example we need to call `.completeQuery` rather than
providing a dummy `completedQuery` object.

The previous factory method was used in the tests for
`query-history-info.test.ts`. Because that factory omitted the
cancellation token, we could get away with having these tests in the
`tests/pure-tests` folder.

With the addition of the second factory method, the tests for
`query-history-info` blow up because they can't find `vscode`.

Now that we need to add more fields to local query history items, it's
becoming clearer that these `query-history-info` tests should live next
to the `query-history` tests in `vscode-tests/no-workspace`.

Granted, in an ideal situation we'd only have one factory method to
generate a local query history item, but combining these two methods
is actually quite painful. So for now let's at least have the query
history tests next to each other and appease Typescript.
This commit is contained in:
Elena Tanasoiu
2022-11-01 09:30:53 +00:00
parent 99af9ca47d
commit 8cfa82f334

View File

@@ -1,19 +1,18 @@
import { expect } from 'chai';
import { QueryStatus } from '../../src/query-status';
import { QueryStatus } from '../../query-status';
import {
buildRepoLabel,
getActionsWorkflowRunUrl,
getQueryId,
getQueryText,
getRawQueryName
} from '../../src/query-history-info';
import { VariantAnalysisHistoryItem } from '../../src/remote-queries/variant-analysis-history-item';
import { createMockVariantAnalysis } from '../../src/vscode-tests/factories/remote-queries/shared/variant-analysis';
import { createMockScannedRepos } from '../../src/vscode-tests/factories/remote-queries/shared/scanned-repositories';
import { createMockLocalQueryInfo } from '../../src/vscode-tests/factories/local-queries/local-query-history-item';
import { createMockRemoteQueryHistoryItem } from '../../src/vscode-tests/factories/remote-queries/remote-query-history-item';
import { VariantAnalysisRepoStatus, VariantAnalysisStatus } from '../../src/remote-queries/shared/variant-analysis';
} from '../../query-history-info';
import { VariantAnalysisHistoryItem } from '../../remote-queries/variant-analysis-history-item';
import { createMockVariantAnalysis } from '../factories/remote-queries/shared/variant-analysis';
import { createMockScannedRepos } from '../factories/remote-queries/shared/scanned-repositories';
import { createMockLocalQueryInfo } from '../factories/local-queries/local-query-history-item';
import { createMockRemoteQueryHistoryItem } from '../factories/remote-queries/remote-query-history-item';
import { VariantAnalysisRepoStatus, VariantAnalysisStatus } from '../../remote-queries/shared/variant-analysis';
describe('Query history info', () => {