From cbc921e6d240ea4a79c61017dfa23a9604447f28 Mon Sep 17 00:00:00 2001 From: Oliver Geer Date: Sun, 30 Aug 2026 23:19:58 +0100 Subject: [PATCH 1/6] Add TypeScript test file; Reorganise test files --- tests/automated/README.md | 7 ++ tests/{ => automated}/afterform.html | 0 tests/{ => automated}/hljs.html | 30 ++--- tests/automated/index.html | 44 ++++++++ tests/{ => automated}/prism.html | 32 +++--- tests/{ => automated}/tester.js | 0 tests/{ => automated}/tester.min.js | 0 tests/i18n/README.md | 9 ++ tests/{i18n-common.js => i18n/common.js} | 0 .../common.min.js} | 0 tests/{i18n-hljs.html => i18n/hljs.html} | 32 +++--- tests/{i18n.html => i18n/index.html} | 4 +- tests/{i18n-prism.html => i18n/prism.html} | 34 +++--- tests/typescript/.gitignore | 1 + tests/typescript/README.md | 7 ++ tests/typescript/example.ts | 105 ++++++++++++++++++ 16 files changed, 239 insertions(+), 66 deletions(-) create mode 100644 tests/automated/README.md rename tests/{ => automated}/afterform.html (100%) rename tests/{ => automated}/hljs.html (69%) create mode 100644 tests/automated/index.html rename tests/{ => automated}/prism.html (68%) rename tests/{ => automated}/tester.js (100%) rename tests/{ => automated}/tester.min.js (100%) create mode 100644 tests/i18n/README.md rename tests/{i18n-common.js => i18n/common.js} (100%) rename tests/{i18n-common.min.js => i18n/common.min.js} (100%) rename tests/{i18n-hljs.html => i18n/hljs.html} (75%) rename tests/{i18n.html => i18n/index.html} (89%) rename tests/{i18n-prism.html => i18n/prism.html} (74%) create mode 100644 tests/typescript/.gitignore create mode 100644 tests/typescript/README.md create mode 100644 tests/typescript/example.ts diff --git a/tests/automated/README.md b/tests/automated/README.md new file mode 100644 index 0000000..c155c35 --- /dev/null +++ b/tests/automated/README.md @@ -0,0 +1,7 @@ +# (Semi-)Automated Tests + +Carries out partially automated user interface tests to check that both the core components and the plugins work in some ways. It doesn't fully cover every scenario so you should test any code you change by hand, but it's good for quickly checking a wide range of functionality works. + +For each of `prism.html` and `hljs.html`, open the page, answer the browser popups you get, and see the results of testing at the end. + +The code currently relies on hardcoded wait periods, assuming the interface will respond in time, and meaning that if they don't, tests can fail. If tests fail unexpectedly, free up memory etc. on your computer, reload, and try again. diff --git a/tests/afterform.html b/tests/automated/afterform.html similarity index 100% rename from tests/afterform.html rename to tests/automated/afterform.html diff --git a/tests/hljs.html b/tests/automated/hljs.html similarity index 69% rename from tests/hljs.html rename to tests/automated/hljs.html index 179e207..43e6f36 100644 --- a/tests/hljs.html +++ b/tests/automated/hljs.html @@ -15,23 +15,23 @@ - - + + - - - - - - - - - - - - - + + + + + + + + + + + + + diff --git a/tests/automated/index.html b/tests/automated/index.html new file mode 100644 index 0000000..4b384a5 --- /dev/null +++ b/tests/automated/index.html @@ -0,0 +1,44 @@ + + + + + + code-input Tester + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/prism.html b/tests/automated/prism.html similarity index 68% rename from tests/prism.html rename to tests/automated/prism.html index 591604b..1832714 100644 --- a/tests/prism.html +++ b/tests/automated/prism.html @@ -10,27 +10,27 @@ - + - - + + - - - - - - - - - - - - - + + + + + + + + + + + + + diff --git a/tests/tester.js b/tests/automated/tester.js similarity index 100% rename from tests/tester.js rename to tests/automated/tester.js diff --git a/tests/tester.min.js b/tests/automated/tester.min.js similarity index 100% rename from tests/tester.min.js rename to tests/automated/tester.min.js diff --git a/tests/i18n/README.md b/tests/i18n/README.md new file mode 100644 index 0000000..f032d90 --- /dev/null +++ b/tests/i18n/README.md @@ -0,0 +1,9 @@ +# Demos with Internationalisation + +A playground of `` elements for manual testing. + +Includes various aspects not in the semi-automated tests: + +- "rtl" elements should have right-to-left text decoration; +- plugins' user interface elements should be translated into Spanish; +- code-input elements' contents include Unicode text in various language. diff --git a/tests/i18n-common.js b/tests/i18n/common.js similarity index 100% rename from tests/i18n-common.js rename to tests/i18n/common.js diff --git a/tests/i18n-common.min.js b/tests/i18n/common.min.js similarity index 100% rename from tests/i18n-common.min.js rename to tests/i18n/common.min.js diff --git a/tests/i18n-hljs.html b/tests/i18n/hljs.html similarity index 75% rename from tests/i18n-hljs.html rename to tests/i18n/hljs.html index 70c64cc..0705eeb 100644 --- a/tests/i18n-hljs.html +++ b/tests/i18n/hljs.html @@ -15,23 +15,23 @@ - - + + - - - - - - - - - - - - - + + + + + + + + + + + + + @@ -47,7 +47,7 @@ - + - + - - + + - - - - - - - - - - - - - + + + + + + + + + + + + + @@ -47,7 +47,7 @@ - +