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

Comprehensive unit tests for the Watermark ASCII art signature system. More...

Go to the source code of this file.

Data Structures

class  MockWebview
 Mock implementation of VS Code webview for testing. More...
 
class  MockWebviewPanel
 Mock implementation of VS Code webview panel for testing. More...
 

Variables

import *as assert from assert
 
import *as vscode from vscode
 
import *as fs from fs promises
 
import *as path from path
 
import *as os from os
 
 import { Watermark, watermark } from '../modules/watermark'
 
fontName __pad0__
 

Detailed Description

Comprehensive unit tests for the Watermark ASCII art signature system.

Author
Henry Letellier
Version
1.0.10
Since
1.0.4
Date
2025

This test suite provides extensive coverage for the Watermark module, which manages the display of ASCII art author signatures and watermarks in VS Code webview panels.

Test Coverage Areas:

  • Constructor initialization and parameter handling
  • File path and working directory management
  • Watermark data loading and validation
  • Random watermark selection algorithms
  • Error handling for invalid data and missing files
  • HTML content generation and webview creation
  • Interactive feature scripts (copy, zoom functionality)
  • Font name display and metadata handling
  • Integration with LazyFileLoader and VS Code APIs

Testing Strategy:

  • Uses real temporary files for authentic file operations
  • Mocks VS Code webview APIs for isolated testing
  • Validates JSON structure and data integrity
  • Tests edge cases and error conditions
  • Verifies HTML output and JavaScript functionality
  • Ensures proper resource cleanup and memory management

Definition in file watermark.test.ts.

Variable Documentation

◆ __pad0__

fontName __pad0__

Definition at line 45 of file watermark.test.ts.

◆ assert

import* as assert from assert

Definition at line 32 of file watermark.test.ts.

◆ import

import { Watermark, watermark } from '../modules/watermark'

Definition at line 37 of file watermark.test.ts.

◆ os

import* as os from os

Definition at line 36 of file watermark.test.ts.

◆ path

import* as path from path

Definition at line 35 of file watermark.test.ts.

◆ promises

import* as fs from fs promises

Definition at line 34 of file watermark.test.ts.

◆ vscode

import* as vscode from vscode

Definition at line 33 of file watermark.test.ts.