From 0666dba344ad5adeb5fa3a080ec5034bcd5cee7c Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Sun, 14 Apr 2019 19:09:08 +0200 Subject: [PATCH] cleanup --- .gitignore | 1 - .travis.yml | 5 +---- src/components/atoms/LinkIcon.test.jsx | 27 +++++++++++++++++--------- 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/.gitignore b/.gitignore index 6c99b9e..b6fedb7 100644 --- a/.gitignore +++ b/.gitignore @@ -11,5 +11,4 @@ yarn-debug.log* yarn.lock package-lock.json plugins/gatsby-plugin-matomo -src/components/svg coverage diff --git a/.travis.yml b/.travis.yml index 6e027ca..ad3f624 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,7 @@ -sudo: required +dist: xenial language: node_js node_js: node -addons: - chrome: beta - cache: directories: - node_modules diff --git a/src/components/atoms/LinkIcon.test.jsx b/src/components/atoms/LinkIcon.test.jsx index 5069ed8..5d33c62 100644 --- a/src/components/atoms/LinkIcon.test.jsx +++ b/src/components/atoms/LinkIcon.test.jsx @@ -4,21 +4,30 @@ import { render } from 'react-testing-library' import LinkIcon from './LinkIcon' describe('LinkIcon', () => { - const link = { - title: 'my project', - type: 'website' - } - it('renders correctly', () => { - const { container } = render( - + const { container, rerender } = render( + ) expect(container.firstChild.nodeName).toBe('svg') + + rerender() + expect(container.firstChild.nodeName).toBe('svg') + + rerender() + expect(container.firstChild.nodeName).toBe('svg') + + rerender() + expect(container.firstChild.nodeName).toBe('svg') + + rerender() + expect(container.firstChild.nodeName).toBe('svg') + + rerender() + expect(container.firstChild.nodeName).toBe('svg') }) it('does not render with unknown type', () => { - const link = { type: 'whatever' } - const { container } = render() + const { container } = render() expect(container.firstChild).not.toBeInTheDocument() }) })