Skip to content

Comments

Add integration test coverage for diagram feature#63

Merged
vobu merged 2 commits intofeat/process-instance-diagramfrom
copilot/sub-pr-60-another-one
Feb 18, 2026
Merged

Add integration test coverage for diagram feature#63
vobu merged 2 commits intofeat/process-instance-diagramfrom
copilot/sub-pr-60-another-one

Conversation

Copy link
Contributor

Copilot AI commented Feb 18, 2026

The diagram feature (--diagram flag for get pi) lacked test coverage per the coding guidelines requirement that all implementations include tests.

Changes

  • Integration tests in tests/integration/process-instances.test.ts:
    • PNG file output validation (verifies signature bytes, file creation)
    • Inline terminal display (validates iTerm2 protocol escape sequences)
    • Error handling for non-existent process instances

Testing Approach

Unit tests evaluated but not implemented — the diagram rendering depends on Puppeteer, headless Chrome, and API calls with tightly coupled private functions. Integration tests provide full end-to-end coverage.

// Example test pattern
test('get process instance with --diagram flag saves PNG to file', async () => {
  const result = await createProcessInstance({ processDefinitionId: 'simple-process' });
  const outputPath = join(tmpDir, 'diagram.png');
  
  execSync(`node src/index.ts get pi --key ${result.processInstanceKey} --diagram --output ${outputPath}`);
  
  const fileContent = readFileSync(outputPath);
  assert.strictEqual(fileContent[0], 0x89); // PNG signature validation
  // ...
});

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: vobu <6573426+vobu@users.noreply.github.com>
Copilot AI changed the title [WIP] Address feedback on PI diagram rendering Add integration test coverage for diagram feature Feb 18, 2026
Copilot AI requested a review from vobu February 18, 2026 14:04
@vobu vobu marked this pull request as ready for review February 18, 2026 14:05
@vobu vobu merged commit 4548c34 into feat/process-instance-diagram Feb 18, 2026
1 check passed
@vobu vobu deleted the copilot/sub-pr-60-another-one branch February 18, 2026 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants