Skip to content

test: split attachments.test.js#492

Merged
eric-pSAP merged 9 commits into
mainfrom
ci/cleanup-tests
Jul 24, 2026
Merged

test: split attachments.test.js#492
eric-pSAP merged 9 commits into
mainfrom
ci/cleanup-tests

Conversation

@stefanrudi

@stefanrudi stefanrudi commented Jul 22, 2026

Copy link
Copy Markdown
Contributor
  • Split the test file attachments.test.js to leverage parallel execution

@hyperspace-pr-bot hyperspace-pr-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR splits a large attachments.test.js into focused files, which is a good structural improvement. Several correctness issues were found: silent test assertions inside .catch() blocks that never execute on 2xx responses (making tests always pass), a double-await pattern copied across two files, a wrong EICAR-like mime type in an error message assertion, a misleading comment that contradicts its assertion, and a magic -1 sentinel value in the shared utility function that could produce a malformed Content-Length header if misused.

PR Bot Information

Version: 1.29.2

  • LLM: anthropic--claude-4.6-sonnet
  • Correlation ID: 328db820-8620-11f1-95b2-b3e78fa5cb02
  • Experiment Variant: control
  • Event Trigger: pull_request.opened
  • File Content Strategy: Full file content

Comment thread tests/integration/attachments-draft.test.js
Comment thread tests/integration/attachments-draft.test.js Outdated
Comment thread tests/integration/attachments-draft.test.js
Comment thread tests/integration/attachments-draft.test.js
Comment thread tests/integration/attachments-draft.test.js
Comment thread tests/integration/attachments-draft.test.js
Comment thread tests/integration/attachments-draft.test.js Outdated
Comment thread tests/integration/attachments-features.test.js
Comment thread tests/integration/attachments-rename.test.js Outdated
Comment thread tests/utils/testUtils.js Outdated
@stefanrudi
stefanrudi marked this pull request as ready for review July 24, 2026 12:41
@stefanrudi
stefanrudi requested a review from a team as a code owner July 24, 2026 12:41
@hyperspace-pr-bot

Copy link
Copy Markdown
Contributor

Summary

The following content is AI-generated and provides a summary of the pull request:


test: Split attachments.test.js into Parallel-Friendly Test Files

♻️ Refactor / Test: The large attachments.test.js integration test file has been split into multiple focused test files to enable parallel test execution and improve maintainability.

Changes

The original monolithic tests/integration/attachments.test.js has been removed and replaced with four focused test files:

  • tests/integration/attachments.test.js: Removed – replaced by the four files below.
  • tests/integration/attachments-draft.test.js: New – covers draft-mode attachment upload/download, scanning, deletion, size limits, and discard behavior for Incidents and composed entities across multiple nesting depths.
  • tests/integration/attachments-features.test.js: New – covers UI metadata (facets, hidden fields), acceptable media type validation, min/max attachment count validation, and row-level security on attachment compositions.
  • tests/integration/attachments-rename.test.js: New – covers duplicate filename deduplication logic, recursive composition safety, the copy() API on AttachmentsService, and draft cancel/discard with nested entities.
  • tests/integration/attachments-single.test.js: New – covers the SingleAttachment (inline attachment field) entity: upload, download, re-scan, discard, delete, malware detection, and MIME type validation.
  • tests/utils/testUtils.js: Added a shared uploadDraftAttachment helper function (with supporting imports) to eliminate duplication across the new test files.

  • 🔄 Regenerate and Update Summary
  • ✏️ Insert as PR Description (deletes this comment)
  • 🗑️ Delete comment
PR Bot Information

Version: 1.29.2

  • Output Template: Default Template
  • File Content Strategy: Full file content
  • Summary Prompt: Default Prompt
  • Event Trigger: pull_request.ready_for_review
  • Correlation ID: f32debd0-875c-11f1-97ec-f18fe9fa1cdc
  • LLM: anthropic--claude-4.6-sonnet

@hyperspace-pr-bot hyperspace-pr-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR splits a large test file into four focused ones and introduces a shared uploadDraftAttachment utility. There are several substantive issues across the new files: assertions silently skipped inside .catch() without guaranteeing the handler ran, a double draftModeEdit call before uploadDraftAttachment (which already calls it internally), a scanCleanWaiter that will always time out because no file content is uploaded, and a handful of wrong IsActiveEntity values and misleading comments. Please address the existing review comments before merging.

PR Bot Information

Version: 1.29.2

  • File Content Strategy: Full file content
  • Experiment Variant: control
  • Event Trigger: pull_request.ready_for_review
  • Correlation ID: f32debd0-875c-11f1-97ec-f18fe9fa1cdc
  • LLM: anthropic--claude-4.6-sonnet

Comment thread tests/integration/attachments-draft.test.js
Comment thread tests/integration/attachments-features.test.js
Comment thread tests/integration/attachments-draft.test.js
Comment thread tests/integration/attachments-draft.test.js
@eric-pSAP
eric-pSAP merged commit 2da290f into main Jul 24, 2026
51 of 57 checks passed
@eric-pSAP
eric-pSAP deleted the ci/cleanup-tests branch July 24, 2026 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants