-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(create-plugin): add test cases for JsSdkTest-5,6,7,8 (#2763)
- Loading branch information
Showing
11 changed files
with
537 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
export { pattern as requiredOptions } from "./requiredOptions"; | ||
export { pattern as pluginNameContain64Chars } from "./pluginNameContain64Chars"; | ||
export { pattern as pluginDescriptionContain200Chars } from "./pluginDescriptionContain200Chars"; | ||
export { pattern as allOptions } from "./allOptions"; | ||
export { pattern as languageEN } from "./languageEN"; | ||
export { pattern as languageJA } from "./languageJA"; | ||
export { pattern as emptyOutputDir } from "./emptyOutputDir"; | ||
export { pattern as pluginNameContain65Chars } from "./pluginNameContain65Chars"; | ||
export { pattern as pluginDescriptionContain201Chars } from "./pluginDescriptionContain201Chars"; | ||
export { pattern as existOutputDir } from "./existOutputDir"; | ||
export { pattern as createKintonePluginCommand } from "./createKintonePluginCommand"; | ||
export { pattern as minimumTemplate } from "./minimumTemplate"; | ||
export { pattern as modernTemplate } from "./modernTemplate"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
import type { TestPattern } from "../e2e.test"; | ||
import { | ||
ANSWER_NO, | ||
ANSWER_YES, | ||
CREATE_PLUGIN_COMMAND, | ||
} from "../utils/constants"; | ||
import { getBoundMessage } from "../../src/messages"; | ||
|
||
const lang = "en"; | ||
const m = getBoundMessage(lang); | ||
|
||
export const pattern: TestPattern = { | ||
description: | ||
"#JsSdkTest-5 Should able to create plugin with --lang argument (EN language)", | ||
input: { | ||
command: CREATE_PLUGIN_COMMAND, | ||
outputDir: "test5", | ||
commandArgument: `--lang ${lang}`, | ||
questionsInput: [ | ||
{ | ||
question: m("Q_NameEn"), | ||
answer: "test5-name", | ||
}, | ||
{ | ||
question: m("Q_DescriptionEn"), | ||
answer: "test5-description", | ||
}, | ||
{ | ||
question: m("Q_SupportJa"), | ||
answer: ANSWER_YES, | ||
}, | ||
{ | ||
question: m("Q_NameJa"), | ||
answer: "私のプラグイン", | ||
}, | ||
{ | ||
question: m("Q_DescriptionJa"), | ||
answer: "私のプラグイン", | ||
}, | ||
{ | ||
question: m("Q_SupportZh"), | ||
answer: ANSWER_YES, | ||
}, | ||
{ | ||
question: m("Q_NameZh"), | ||
answer: "我的插件", | ||
}, | ||
{ | ||
question: m("Q_DescriptionZh"), | ||
answer: "我的插件", | ||
}, | ||
{ | ||
question: m("Q_WebsiteUrlEn"), | ||
answer: "https://github.com", | ||
}, | ||
{ | ||
question: m("Q_WebsiteUrlJa"), | ||
answer: "https://github.jp", | ||
}, | ||
{ | ||
question: m("Q_WebsiteUrlZh"), | ||
answer: "https://github.cn", | ||
}, | ||
{ | ||
question: m("Q_MobileSupport"), | ||
answer: ANSWER_NO, | ||
}, | ||
{ | ||
question: m("Q_EnablePluginUploader"), | ||
answer: ANSWER_NO, | ||
}, | ||
], | ||
}, | ||
expected: { | ||
success: { | ||
manifestJson: { | ||
name: { | ||
en: "test5-name", | ||
ja: "私のプラグイン", | ||
zh: "我的插件", | ||
}, | ||
description: { | ||
en: "test5-description", | ||
ja: "私のプラグイン", | ||
zh: "我的插件", | ||
}, | ||
homepage_url: { | ||
en: "https://github.com", | ||
ja: "https://github.jp", | ||
zh: "https://github.cn", | ||
}, | ||
}, | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
import type { TestPattern } from "../e2e.test"; | ||
import { | ||
ANSWER_NO, | ||
ANSWER_YES, | ||
CREATE_PLUGIN_COMMAND, | ||
} from "../utils/constants"; | ||
import { getBoundMessage } from "../../src/messages"; | ||
|
||
const lang = "ja"; | ||
const m = getBoundMessage(lang); | ||
|
||
export const pattern: TestPattern = { | ||
description: | ||
"#JsSdkTest-6 Should able to create plugin with --lang argument (JA language)", | ||
input: { | ||
command: CREATE_PLUGIN_COMMAND, | ||
outputDir: "test6", | ||
commandArgument: `--lang ${lang}`, | ||
questionsInput: [ | ||
{ | ||
question: m("Q_NameEn"), | ||
answer: "test6-name", | ||
}, | ||
{ | ||
question: m("Q_DescriptionEn"), | ||
answer: "test6-description", | ||
}, | ||
{ | ||
question: m("Q_SupportJa"), | ||
answer: ANSWER_YES, | ||
}, | ||
{ | ||
question: m("Q_NameJa"), | ||
answer: "私のプラグイン", | ||
}, | ||
{ | ||
question: m("Q_DescriptionJa"), | ||
answer: "私のプラグイン", | ||
}, | ||
{ | ||
question: m("Q_SupportZh"), | ||
answer: ANSWER_YES, | ||
}, | ||
{ | ||
question: m("Q_NameZh"), | ||
answer: "我的插件", | ||
}, | ||
{ | ||
question: m("Q_DescriptionZh"), | ||
answer: "我的插件", | ||
}, | ||
{ | ||
question: m("Q_WebsiteUrlEn"), | ||
answer: "https://github.com", | ||
}, | ||
{ | ||
question: m("Q_WebsiteUrlJa"), | ||
answer: "https://github.jp", | ||
}, | ||
{ | ||
question: m("Q_WebsiteUrlZh"), | ||
answer: "https://github.cn", | ||
}, | ||
{ | ||
question: m("Q_MobileSupport"), | ||
answer: ANSWER_NO, | ||
}, | ||
{ | ||
question: m("Q_EnablePluginUploader"), | ||
answer: ANSWER_NO, | ||
}, | ||
], | ||
}, | ||
expected: { | ||
success: { | ||
manifestJson: { | ||
name: { | ||
en: "test6-name", | ||
ja: "私のプラグイン", | ||
zh: "我的插件", | ||
}, | ||
description: { | ||
en: "test6-description", | ||
ja: "私のプラグイン", | ||
zh: "我的插件", | ||
}, | ||
homepage_url: { | ||
en: "https://github.com", | ||
ja: "https://github.jp", | ||
zh: "https://github.cn", | ||
}, | ||
}, | ||
}, | ||
}, | ||
}; |
63 changes: 63 additions & 0 deletions
63
packages/create-plugin/__e2e__/fixtures/minimumTemplate.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import type { TestPattern } from "../e2e.test"; | ||
import { | ||
ANSWER_NO, | ||
CREATE_PLUGIN_COMMAND, | ||
DEFAULT_ANSWER, | ||
} from "../utils/constants"; | ||
import { getBoundMessage } from "../../src/messages"; | ||
|
||
const m = getBoundMessage("en"); | ||
const template = "minimum"; | ||
|
||
export const pattern: TestPattern = { | ||
description: | ||
"#JsSdkTest-7 Should able to create a plugin with minimum template", | ||
input: { | ||
command: CREATE_PLUGIN_COMMAND, | ||
outputDir: "test7", | ||
commandArgument: `--template ${template}`, | ||
template, | ||
questionsInput: [ | ||
{ | ||
question: m("Q_NameEn"), | ||
answer: "test7-name", | ||
}, | ||
{ | ||
question: m("Q_DescriptionEn"), | ||
answer: "test7-description", | ||
}, | ||
{ | ||
question: m("Q_SupportJa"), | ||
answer: DEFAULT_ANSWER, | ||
}, | ||
{ | ||
question: m("Q_SupportZh"), | ||
answer: DEFAULT_ANSWER, | ||
}, | ||
{ | ||
question: m("Q_WebsiteUrlEn"), | ||
answer: DEFAULT_ANSWER, | ||
}, | ||
{ | ||
question: m("Q_MobileSupport"), | ||
answer: ANSWER_NO, | ||
}, | ||
{ | ||
question: m("Q_EnablePluginUploader"), | ||
answer: ANSWER_NO, | ||
}, | ||
], | ||
}, | ||
expected: { | ||
success: { | ||
manifestJson: { | ||
name: { en: "test7-name" }, | ||
description: { en: "test7-description" }, | ||
desktop: { | ||
js: ["js/desktop.js"], | ||
css: ["css/51-modern-default.css", "css/desktop.css"], | ||
}, | ||
}, | ||
}, | ||
}, | ||
}; |
Oops, something went wrong.