feat : adding dialog to choose language
This commit is contained in:
@@ -17,6 +17,8 @@ describe("image export controls", () => {
|
||||
expect(html).toContain("ส่งออกภาพโดยไม่รวมโน้ต");
|
||||
expect(html).toContain("ไทย");
|
||||
expect(html).toContain("English");
|
||||
expect(html).toContain('data-language-flag="th"');
|
||||
expect(html).toContain('data-language-flag="en"');
|
||||
expect(html.match(/<button\b/gu)).toHaveLength(4);
|
||||
});
|
||||
|
||||
@@ -27,6 +29,22 @@ describe("image export controls", () => {
|
||||
expect(html.match(/<button\b/gu)).toHaveLength(3);
|
||||
});
|
||||
|
||||
it("hides the persistent language chooser when language is prompted on export", () => {
|
||||
const html = renderToStaticMarkup(
|
||||
<GuideImageExport
|
||||
fileName="guide.png"
|
||||
allowWithoutNotes={false}
|
||||
showLanguageSelector={false}
|
||||
promptForLanguage
|
||||
>
|
||||
Content
|
||||
</GuideImageExport>,
|
||||
);
|
||||
expect(html).not.toContain("ภาษาในภาพส่งออก");
|
||||
expect(html).not.toContain("English");
|
||||
expect(html.match(/<button\b/gu)).toHaveLength(1);
|
||||
});
|
||||
|
||||
it("disables both modes when an export selection is empty", () => {
|
||||
const html = renderToStaticMarkup(<GuideImageExport fileName="guide.png" disabled>No sections</GuideImageExport>);
|
||||
expect(html.match(/\sdisabled=""/gu)).toHaveLength(2);
|
||||
|
||||
Reference in New Issue
Block a user