Skip to content

Fix upload URL test for sanitized filenames - #9

Merged
wickedyoda merged 1 commit into
mainfrom
feature/ghcr-ci-and-upload-improvements
Apr 12, 2026
Merged

Fix upload URL test for sanitized filenames#9
wickedyoda merged 1 commit into
mainfrom
feature/ghcr-ci-and-upload-improvements

Conversation

@wickedyoda

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings April 12, 2026 22:44
@wickedyoda
wickedyoda merged commit d50113f into main Apr 12, 2026
1 check passed
@wickedyoda
wickedyoda deleted the feature/ghcr-ci-and-upload-improvements branch April 12, 2026 22:44

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Updates the Upload API test to accommodate server-side filename sanitization so the “upload completes” response assertion no longer expects the unsanitized input name.

Changes:

  • Adjusted the chunk-completion test to assert the downloadUrl suffix using the returned file.filename rather than a hard-coded filename.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread test/upload.test.js
Comment on lines 233 to +237
assert.strictEqual(chunkResponse.status, 200);
assert.strictEqual(chunkResponse.data.completed, true);
assert.ok(chunkResponse.data.file);
assert.ok(typeof chunkResponse.data.file.downloadUrl === 'string');
assert.ok(chunkResponse.data.file.downloadUrl.endsWith('/complete-test.txt'));
assert.ok(chunkResponse.data.file.downloadUrl.endsWith(`/${chunkResponse.data.file.filename}`));

Copilot AI Apr 12, 2026

Copy link

Choose a reason for hiding this comment

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

This assertion is now self-referential: it only checks that downloadUrl ends with whatever file.filename the API returns. That can let regressions slip through (e.g., incorrect sanitization/normalization of the requested name) because the test no longer validates what the filename should be for the input complete-test.txt. Consider asserting an expected sanitized filename (e.g., derived from the known sanitization rules) and then verifying downloadUrl ends with that encoded/sanitized value.

Copilot uses AI. Check for mistakes.
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