aboutsummaryrefslogtreecommitdiff
path: root/vnext/src
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-06-20 22:46:37 +0300
committerGravatar Vitaly Takmazov2023-01-13 10:37:53 +0300
commitc3e791ae2357bbe220c133e3ab417bd5f7c55410 (patch)
tree2061468a182b85ec94f0c33008b47ea780900a12 /vnext/src
parent64a73c43afded0c5bb30ea15ce11adc15b5b2ef5 (diff)
initial unit testing setup
Diffstat (limited to 'vnext/src')
-rw-r--r--vnext/src/components/__tests__/Avatar.test.js15
-rw-r--r--vnext/src/components/__tests__/__snapshots__/Avatar.test.js.snap17
2 files changed, 32 insertions, 0 deletions
diff --git a/vnext/src/components/__tests__/Avatar.test.js b/vnext/src/components/__tests__/Avatar.test.js
new file mode 100644
index 00000000..ac33abe9
--- /dev/null
+++ b/vnext/src/components/__tests__/Avatar.test.js
@@ -0,0 +1,15 @@
+import React from 'react';
+import { MemoryRouter } from 'react-router-dom';
+
+import Avatar from '../Avatar';
+import renderer from 'react-test-renderer';
+
+test('Avatar renders correctly', () => {
+ const component = renderer.create(
+ <MemoryRouter>
+ <Avatar user={{ uid: 1, uname: 'ugnich' }} />
+ </MemoryRouter>
+ );
+ let tree = component.toJSON();
+ expect(tree).toMatchSnapshot();
+}); \ No newline at end of file
diff --git a/vnext/src/components/__tests__/__snapshots__/Avatar.test.js.snap b/vnext/src/components/__tests__/__snapshots__/Avatar.test.js.snap
new file mode 100644
index 00000000..175befa0
--- /dev/null
+++ b/vnext/src/components/__tests__/__snapshots__/Avatar.test.js.snap
@@ -0,0 +1,17 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`Avatar renders correctly 1`] = `
+<div
+ className="msg-avatar"
+>
+ <a
+ href="/ugnich/"
+ onClick={[Function]}
+ >
+ <img
+ alt="ugnich"
+ src="//i.juick.com/a/1.png"
+ />
+ </a>
+</div>
+`;