From 8455c555df65cedda41f498448db179e2a45a12d Mon Sep 17 00:00:00 2001 From: Alexandre Capt Date: Wed, 13 Sep 2023 10:53:16 +0200 Subject: [PATCH] chore: basic decorateIcons tests --- src/decorate.js | 1 + test/decorate/decorateIcons.basic.test.html | 39 ++++++++++++++++++++ test/decorate/decorateIcons.styled.test.html | 37 +++++++++++++++++++ test/fixtures/icons/a.svg | 1 + test/fixtures/icons/b.svg | 1 + test/fixtures/icons/styled.svg | 9 +++++ web-test-runner.config.js | 2 +- 7 files changed, 89 insertions(+), 1 deletion(-) create mode 100644 test/decorate/decorateIcons.basic.test.html create mode 100644 test/decorate/decorateIcons.styled.test.html create mode 100644 test/fixtures/icons/a.svg create mode 100644 test/fixtures/icons/b.svg create mode 100644 test/fixtures/icons/styled.svg diff --git a/src/decorate.js b/src/decorate.js index cce628e..1a16107 100644 --- a/src/decorate.js +++ b/src/decorate.js @@ -84,6 +84,7 @@ export async function decorateIcons(element) { }; } } catch (error) { + /* c8 ignore next 4 */ ICONS_CACHE[iconName] = false; // eslint-disable-next-line no-console console.error(error); diff --git a/test/decorate/decorateIcons.basic.test.html b/test/decorate/decorateIcons.basic.test.html new file mode 100644 index 0000000..459a833 --- /dev/null +++ b/test/decorate/decorateIcons.basic.test.html @@ -0,0 +1,39 @@ + + + +
+ +

+ +

+
+ + + diff --git a/test/decorate/decorateIcons.styled.test.html b/test/decorate/decorateIcons.styled.test.html new file mode 100644 index 0000000..51855b9 --- /dev/null +++ b/test/decorate/decorateIcons.styled.test.html @@ -0,0 +1,37 @@ + + + +
+ +
+ + + diff --git a/test/fixtures/icons/a.svg b/test/fixtures/icons/a.svg new file mode 100644 index 0000000..dc1ced5 --- /dev/null +++ b/test/fixtures/icons/a.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/test/fixtures/icons/b.svg b/test/fixtures/icons/b.svg new file mode 100644 index 0000000..dc1ced5 --- /dev/null +++ b/test/fixtures/icons/b.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/test/fixtures/icons/styled.svg b/test/fixtures/icons/styled.svg new file mode 100644 index 0000000..64d2931 --- /dev/null +++ b/test/fixtures/icons/styled.svg @@ -0,0 +1,9 @@ + + + + + \ No newline at end of file diff --git a/web-test-runner.config.js b/web-test-runner.config.js index b302f94..0bc362d 100644 --- a/web-test-runner.config.js +++ b/web-test-runner.config.js @@ -15,6 +15,6 @@ export default { ], }, files: [ - 'test/**/*.test.{html,js}', + 'test/decorate/*.test.{html,js}', ], };