From 780c7f8775b0eafb924740367b31acb61f5e227c Mon Sep 17 00:00:00 2001 From: Johannes Schill Date: Wed, 31 Jan 2018 16:48:45 +0100 Subject: [PATCH] tests: Add TeamPicker test and update TeamPicker/UserPicker snapshots so they match the latest classNames update #10676 --- .../components/Picker/TeamPicker.jest.tsx | 19 ++++ .../__snapshots__/TeamPicker.jest.tsx.snap | 98 +++++++++++++++++++ .../__snapshots__/UserPicker.jest.tsx.snap | 2 +- 3 files changed, 118 insertions(+), 1 deletion(-) create mode 100644 public/app/core/components/Picker/TeamPicker.jest.tsx create mode 100644 public/app/core/components/Picker/__snapshots__/TeamPicker.jest.tsx.snap diff --git a/public/app/core/components/Picker/TeamPicker.jest.tsx b/public/app/core/components/Picker/TeamPicker.jest.tsx new file mode 100644 index 00000000000..20b7620e0ac --- /dev/null +++ b/public/app/core/components/Picker/TeamPicker.jest.tsx @@ -0,0 +1,19 @@ +import React from 'react'; +import renderer from 'react-test-renderer'; +import TeamPicker from './TeamPicker'; + +const model = { + backendSrv: { + get: () => { + return new Promise((resolve, reject) => {}); + }, + }, + handlePicked: () => {}, +}; + +describe('TeamPicker', () => { + it('renders correctly', () => { + const tree = renderer.create().toJSON(); + expect(tree).toMatchSnapshot(); + }); +}); diff --git a/public/app/core/components/Picker/__snapshots__/TeamPicker.jest.tsx.snap b/public/app/core/components/Picker/__snapshots__/TeamPicker.jest.tsx.snap new file mode 100644 index 00000000000..67232d0ea5b --- /dev/null +++ b/public/app/core/components/Picker/__snapshots__/TeamPicker.jest.tsx.snap @@ -0,0 +1,98 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`TeamPicker renders correctly 1`] = ` +
+
+
+ +
+ Loading... +
+
+ +
+ +
+
+
+
+
+
+`; diff --git a/public/app/core/components/Picker/__snapshots__/UserPicker.jest.tsx.snap b/public/app/core/components/Picker/__snapshots__/UserPicker.jest.tsx.snap index a1563ba8bc3..3262dc10efe 100644 --- a/public/app/core/components/Picker/__snapshots__/UserPicker.jest.tsx.snap +++ b/public/app/core/components/Picker/__snapshots__/UserPicker.jest.tsx.snap @@ -5,7 +5,7 @@ exports[`UserPicker renders correctly 1`] = ` className="user-picker" >