-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(deleteAppMaps.ts): add closeEditorByUri function after deleting …
…appmaps feat(contextMenu.ts): update deleteAppMap command to handle absence of item object feat(deleteAppMap.test.ts): add new integration test for deleteAppMap fix(closeEditorByUri.test.ts): fix test to include input conditions feat(deleteAppMaps.ts): add clear method to AppMapCollection after closing editors feat(appmapCollection.ts): introduce clear method in AppMapCollection interface feat(appmapCollectionFile.ts): implement clear method for AppMapCollectionFile class
- Loading branch information
Showing
6 changed files
with
75 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import * as vscode from 'vscode'; | ||
import { assert } from 'chai'; | ||
import { join } from 'path'; | ||
import * as sinon from 'sinon'; | ||
import { initializeWorkspace, ProjectA, waitForExtension } from '../util'; | ||
|
||
describe('deleteAppMap test', function () { | ||
let sandbox: sinon.SinonSandbox; | ||
|
||
const appmapFilePath = join( | ||
ProjectA, | ||
'tmp/appmap/minitest', | ||
'Microposts_controller_can_get_microposts_as_JSON.appmap.json' | ||
); | ||
|
||
beforeEach(() => (sandbox = sinon.createSandbox())); | ||
beforeEach(initializeWorkspace); | ||
beforeEach(async () => await waitForExtension()); | ||
|
||
afterEach(initializeWorkspace); | ||
afterEach(() => sandbox.restore()); | ||
|
||
it('deletes appmap with matching URI', async () => { | ||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
const mockUri: vscode.Uri = { path: appmapFilePath } as any; | ||
await vscode.workspace.openTextDocument(mockUri); | ||
await vscode.window.showTextDocument(vscode.Uri.file(mockUri.path)); | ||
await vscode.commands.executeCommand('appmap.context.deleteAppMap'); | ||
|
||
const tabs = vscode.window.tabGroups.all.map((tg) => tg.tabs).flat(); | ||
const index = tabs.findIndex( | ||
(tab) => | ||
(tab.input instanceof vscode.TabInputCustom || | ||
tab.input instanceof vscode.TabInputText || | ||
tab.input instanceof vscode.TabInputNotebook) && | ||
tab.input.uri.path === mockUri.path | ||
); | ||
assert.isTrue(index === -1); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters