From 0ffa3aa3b1af68a4d069dd1f18a71e76f1ee497f Mon Sep 17 00:00:00 2001 From: Guz013 <43732358+Guz013@users.noreply.github.com> Date: Mon, 26 Jun 2023 16:35:01 -0300 Subject: [PATCH] =?UTF-8?q?test(banners):=20=F0=9F=9A=A8=20different=20ico?= =?UTF-8?q?n=20providing=20methods?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../__snapshots__/icons-withIconifyIcon.svg | 1 + packages/banners/tests/icons.test.js | 44 +++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 packages/banners/tests/__snapshots__/icons-withIconifyIcon.svg create mode 100644 packages/banners/tests/icons.test.js diff --git a/packages/banners/tests/__snapshots__/icons-withIconifyIcon.svg b/packages/banners/tests/__snapshots__/icons-withIconifyIcon.svg new file mode 100644 index 0000000..dafc54d --- /dev/null +++ b/packages/banners/tests/__snapshots__/icons-withIconifyIcon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/packages/banners/tests/icons.test.js b/packages/banners/tests/icons.test.js new file mode 100644 index 0000000..529c9fe --- /dev/null +++ b/packages/banners/tests/icons.test.js @@ -0,0 +1,44 @@ +import { describe, expect, it } from 'vitest'; +import banner from '../src/index'; + +describe('Iconify icons', async () => { + it('API\'s Iconify icon', async () => { + const result = await banner({ + title: 'Hello World', + subtitle: 'This is a test', + // eslint-disable-next-line spellcheck/spell-checker + icon: 'solar:test-tube-minimalistic-bold-duotone', + }); + expect(result.toString()).toMatchFileSnapshot('./__snapshots__/icons-withIconifyIcon.svg'); + }); + + it('Local Iconify icon', async () => { + const result = await banner({ + title: 'Hello World', + subtitle: 'This is a test', + icon: ` + + + + + + + + `.toString(), + }); + expect(result.toString()).toMatchFileSnapshot('./__snapshots__/icons-withIconifyIcon.svg'); + }); + + it('URL Iconify icon', async () => { + const result = await banner({ + title: 'Hello World', + subtitle: 'This is a test', + icon: 'https://api.iconify.design/solar:test-tube-minimalistic-bold-duotone.svg', + }); + expect(result.toString()).toMatchFileSnapshot('./__snapshots__/icons-withIconifyIcon.svg'); + }); +});