Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: set content type when uploading edited template#15440

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
ethanndickson merged 1 commit intomainfromethan/fix-template-edit
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -226,6 +226,28 @@ test("Patch request is not send when there are no changes", async () => {
expect(patchTemplateVersion).toBeCalledTimes(0);
});

test("The file is uploaded with the correct content type", async () => {
const user = userEvent.setup();
renderTemplateEditorPage();
const topbar = await screen.findByTestId("topbar");

const newTemplateVersion = {
...MockTemplateVersion,
id: "new-version-id",
name: "new-version",
};

await typeOnEditor("new content", user);
await buildTemplateVersion(newTemplateVersion, user, topbar);

expect(API.uploadFile).toHaveBeenCalledWith(
expect.objectContaining({
name: "template.tar",
type: "application/x-tar",
}),
);
});

describe.each([
{
testName: "Do not ask when template version has no errors",
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -329,7 +329,7 @@ const generateVersionFiles = async (
tar.addFolder(fullPath, baseFileInfo);
});
const blob = (await tar.write()) as Blob;
return new File([blob], "template.tar");
return new File([blob], "template.tar", { type: "application/x-tar" });
};

const publishVersion = async (options: {
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp