Asper Header  1.0.14
The header injector extension
Loading...
Searching...
No Matches
querier.test.ts File Reference

Comprehensive test suite for the Query user interaction system. More...

Go to the source code of this file.

Variables

import *as assert from assert
 
import *as vscode from vscode
 
 import { Query, query } from '../modules/querier'
 
let mockInputBoxResponse
 Mock state variables for VS Code UI testing.
 
let mockQuickPickResponse
 Mock response for quick pick dialogs.
 
let mockInputBoxCallCount = 0
 Counter for input box method calls.
 
let mockQuickPickCallCount = 0
 Counter for quick pick method calls.
 
let mockLastInputOptions
 Last captured input box options for validation.
 
let mockLastQuickPickItems
 Last captured quick pick items for validation.
 
let mockLastQuickPickOptions
 Last captured quick pick options for validation.
 
let originalShowInputBox
 Storage for original VS Code API methods.
 
let originalShowQuickPick
 Original showQuickPick implementation.
 

Detailed Description

Comprehensive test suite for the Query user interaction system.

Author
Henry Letellier
Version
1.0.10
Since
1.0.4
Date
2025

This test suite provides extensive coverage for the Query module, which manages user input collection through VS Code's input box and quick pick dialogs.

Test Coverage Areas:

  • Input box text collection with validation
  • Quick pick option selection functionality
  • User input validation and error handling
  • VS Code UI integration and mocking
  • Dialog configuration and behavior
  • Promise-based user interaction patterns

Testing Strategy:

  • Mocks VS Code's showInputBox and showQuickPick APIs
  • Tests both successful and cancelled user interactions
  • Validates input options and configuration parameters
  • Ensures proper error handling and edge cases
  • Verifies integration with extension workflow

Definition in file querier.test.ts.

Variable Documentation

◆ assert

import* as assert from assert

Definition at line 28 of file querier.test.ts.

◆ import

import { Query, query } from '../modules/querier'

Definition at line 30 of file querier.test.ts.

◆ mockInputBoxCallCount

let mockInputBoxCallCount = 0

Counter for input box method calls.

Definition at line 46 of file querier.test.ts.

◆ mockInputBoxResponse

let mockInputBoxResponse

Mock state variables for VS Code UI testing.

These variables track the mock responses and call counts for VS Code's input dialog methods during testing.

Mock response for input box dialogs

Definition at line 40 of file querier.test.ts.

◆ mockLastInputOptions

let mockLastInputOptions

Last captured input box options for validation.

Definition at line 52 of file querier.test.ts.

◆ mockLastQuickPickItems

let mockLastQuickPickItems

Last captured quick pick items for validation.

Definition at line 55 of file querier.test.ts.

◆ mockLastQuickPickOptions

let mockLastQuickPickOptions

Last captured quick pick options for validation.

Definition at line 58 of file querier.test.ts.

◆ mockQuickPickCallCount

let mockQuickPickCallCount = 0

Counter for quick pick method calls.

Definition at line 49 of file querier.test.ts.

◆ mockQuickPickResponse

let mockQuickPickResponse

Mock response for quick pick dialogs.

Definition at line 43 of file querier.test.ts.

◆ originalShowInputBox

let originalShowInputBox

Storage for original VS Code API methods.

These variables store the original implementations so they can be restored after testing completes.

Original showInputBox implementation

Definition at line 68 of file querier.test.ts.

◆ originalShowQuickPick

let originalShowQuickPick

Original showQuickPick implementation.

Definition at line 71 of file querier.test.ts.

◆ vscode

import* as vscode from vscode

Definition at line 29 of file querier.test.ts.