diff --git a/src/components/common/fork-awesome/__snapshots__/fork-awesome-icon.test.tsx.snap b/src/components/common/fork-awesome/__snapshots__/fork-awesome-icon.test.tsx.snap new file mode 100644 index 000000000..238394832 --- /dev/null +++ b/src/components/common/fork-awesome/__snapshots__/fork-awesome-icon.test.tsx.snap @@ -0,0 +1,65 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[` 1`] = ` +
+ +
+`; + +exports[`ForkAwesomeIcon renders a heart correctly 1`] = ` +
+ +
+`; + +exports[`ForkAwesomeIcon renders in size 2x 1`] = ` +
+ +
+`; + +exports[`ForkAwesomeIcon renders in size 3x 1`] = ` +
+ +
+`; + +exports[`ForkAwesomeIcon renders in size 4x 1`] = ` +
+ +
+`; + +exports[`ForkAwesomeIcon renders in size 5x 1`] = ` +
+ +
+`; + +exports[`ForkAwesomeIcon renders with additional className 1`] = ` +
+ +
+`; + +exports[`ForkAwesomeIcon renders with fixed width icon 1`] = ` +
+ +
+`; diff --git a/src/components/common/fork-awesome/__snapshots__/fork-awesome-stack.test.tsx.snap b/src/components/common/fork-awesome/__snapshots__/fork-awesome-stack.test.tsx.snap new file mode 100644 index 000000000..96f4a77fd --- /dev/null +++ b/src/components/common/fork-awesome/__snapshots__/fork-awesome-stack.test.tsx.snap @@ -0,0 +1,76 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`ForkAwesomeStack renders a heart and a download icon stack 1`] = ` +
+ + + + +
+`; + +exports[`ForkAwesomeStack renders in size 2x 1`] = ` +
+ + + + +
+`; + +exports[`ForkAwesomeStack renders in size 3x 1`] = ` +
+ + + + +
+`; + +exports[`ForkAwesomeStack renders in size 4x 1`] = ` +
+ + + + +
+`; + +exports[`ForkAwesomeStack renders in size 5x 1`] = ` +
+ + + + +
+`; diff --git a/src/components/common/fork-awesome/fork-awesome-icon.test.tsx b/src/components/common/fork-awesome/fork-awesome-icon.test.tsx new file mode 100644 index 000000000..d2b7bbd49 --- /dev/null +++ b/src/components/common/fork-awesome/fork-awesome-icon.test.tsx @@ -0,0 +1,47 @@ +/* + * SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file) + * + * SPDX-License-Identifier: AGPL-3.0-only + */ + +import type { IconName } from './types' +import { render } from '@testing-library/react' +import { ForkAwesomeIcon } from './fork-awesome-icon' + +describe('ForkAwesomeIcon', () => { + const icon: IconName = 'heart' + it('renders a heart correctly', () => { + const view = render() + expect(view.container).toMatchSnapshot() + }) + it('renders with fixed width icon', () => { + const view = render() + expect(view.container).toMatchSnapshot() + }) + it('renders with additional className', () => { + const view = render() + expect(view.container).toMatchSnapshot() + }) + describe('renders in size', () => { + it('2x', () => { + const view = render() + expect(view.container).toMatchSnapshot() + }) + it('3x', () => { + const view = render() + expect(view.container).toMatchSnapshot() + }) + it('4x', () => { + const view = render() + expect(view.container).toMatchSnapshot() + }) + it('5x', () => { + const view = render() + expect(view.container).toMatchSnapshot() + }) + }) + describe('renders in stack', () => { + const view = render() + expect(view.container).toMatchSnapshot() + }) +}) diff --git a/src/components/common/fork-awesome/fork-awesome-stack.test.tsx b/src/components/common/fork-awesome/fork-awesome-stack.test.tsx new file mode 100644 index 000000000..fd1466545 --- /dev/null +++ b/src/components/common/fork-awesome/fork-awesome-stack.test.tsx @@ -0,0 +1,40 @@ +/* + * SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file) + * + * SPDX-License-Identifier: AGPL-3.0-only + */ + +import { render } from '@testing-library/react' +import { ForkAwesomeStack } from './fork-awesome-stack' +import type { ForkAwesomeIconProps } from './fork-awesome-icon' +import { ForkAwesomeIcon } from './fork-awesome-icon' +import type { ReactElement } from 'react' + +describe('ForkAwesomeStack', () => { + const stack: Array> = [ + , + + ] + it('renders a heart and a download icon stack', () => { + const view = render({stack}) + expect(view.container).toMatchSnapshot() + }) + describe('renders in size', () => { + it('2x', () => { + const view = render({stack}) + expect(view.container).toMatchSnapshot() + }) + it('3x', () => { + const view = render({stack}) + expect(view.container).toMatchSnapshot() + }) + it('4x', () => { + const view = render({stack}) + expect(view.container).toMatchSnapshot() + }) + it('5x', () => { + const view = render({stack}) + expect(view.container).toMatchSnapshot() + }) + }) +})