From 8a3b8823ee4f018663f5e5c9837d9ed0b00bb44b Mon Sep 17 00:00:00 2001 From: John Mitchell Date: Wed, 31 Oct 2018 14:44:18 -0400 Subject: [PATCH] move login page test under pages and add tests for all pages stubs --- __tests__/tests/pages/Applications.jsx | 29 ++++++++++ __tests__/tests/pages/AuthSettings.jsx | 29 ++++++++++ __tests__/tests/pages/CredentialTypes.jsx | 29 ++++++++++ __tests__/tests/pages/Credentials.jsx | 29 ++++++++++ __tests__/tests/pages/Dashboard.jsx | 29 ++++++++++ __tests__/tests/pages/InstanceGroups.jsx | 29 ++++++++++ __tests__/tests/pages/Inventories.jsx | 29 ++++++++++ __tests__/tests/pages/InventoryScripts.jsx | 29 ++++++++++ __tests__/tests/pages/Jobs.jsx | 29 ++++++++++ __tests__/tests/pages/JobsSettings.jsx | 29 ++++++++++ __tests__/tests/pages/License.jsx | 29 ++++++++++ .../{LoginPage.test.jsx => pages/Login.jsx} | 6 +-- __tests__/tests/pages/ManagementJobs.jsx | 29 ++++++++++ .../tests/pages/NotifcationTemplates.jsx | 29 ++++++++++ __tests__/tests/pages/Organizations.jsx | 54 +++++++++++++++++++ __tests__/tests/pages/Portal.jsx | 29 ++++++++++ __tests__/tests/pages/Projects.jsx | 29 ++++++++++ __tests__/tests/pages/Schedules.jsx | 29 ++++++++++ __tests__/tests/pages/SystemSettings.jsx | 29 ++++++++++ __tests__/tests/pages/Teams.jsx | 29 ++++++++++ __tests__/tests/pages/Templates.jsx | 29 ++++++++++ __tests__/tests/pages/UISettings.jsx | 29 ++++++++++ __tests__/tests/pages/Users.jsx | 29 ++++++++++ 23 files changed, 666 insertions(+), 3 deletions(-) create mode 100644 __tests__/tests/pages/Applications.jsx create mode 100644 __tests__/tests/pages/AuthSettings.jsx create mode 100644 __tests__/tests/pages/CredentialTypes.jsx create mode 100644 __tests__/tests/pages/Credentials.jsx create mode 100644 __tests__/tests/pages/Dashboard.jsx create mode 100644 __tests__/tests/pages/InstanceGroups.jsx create mode 100644 __tests__/tests/pages/Inventories.jsx create mode 100644 __tests__/tests/pages/InventoryScripts.jsx create mode 100644 __tests__/tests/pages/Jobs.jsx create mode 100644 __tests__/tests/pages/JobsSettings.jsx create mode 100644 __tests__/tests/pages/License.jsx rename __tests__/tests/{LoginPage.test.jsx => pages/Login.jsx} (97%) create mode 100644 __tests__/tests/pages/ManagementJobs.jsx create mode 100644 __tests__/tests/pages/NotifcationTemplates.jsx create mode 100644 __tests__/tests/pages/Organizations.jsx create mode 100644 __tests__/tests/pages/Portal.jsx create mode 100644 __tests__/tests/pages/Projects.jsx create mode 100644 __tests__/tests/pages/Schedules.jsx create mode 100644 __tests__/tests/pages/SystemSettings.jsx create mode 100644 __tests__/tests/pages/Teams.jsx create mode 100644 __tests__/tests/pages/Templates.jsx create mode 100644 __tests__/tests/pages/UISettings.jsx create mode 100644 __tests__/tests/pages/Users.jsx diff --git a/__tests__/tests/pages/Applications.jsx b/__tests__/tests/pages/Applications.jsx new file mode 100644 index 0000000000..21f88674a6 --- /dev/null +++ b/__tests__/tests/pages/Applications.jsx @@ -0,0 +1,29 @@ +import React from 'react'; +import { mount } from 'enzyme'; +import Applications from '../../../src/pages/Applications'; + +describe('', () => { + let pageWrapper; + let pageSections; + let title; + + beforeEach(() => { + pageWrapper = mount(); + pageSections = pageWrapper.find('PageSection'); + title = pageWrapper.find('Title'); + }); + + afterEach(() => { + pageWrapper.unmount(); + }); + + test('initially renders without crashing', () => { + expect(pageWrapper.length).toBe(1); + expect(pageSections.length).toBe(2); + expect(title.length).toBe(1); + expect(title.props().size).toBe('2xl'); + pageSections.forEach(section => { + expect(section.props().variant).toBeDefined(); + }); + }); +}); diff --git a/__tests__/tests/pages/AuthSettings.jsx b/__tests__/tests/pages/AuthSettings.jsx new file mode 100644 index 0000000000..84eb451938 --- /dev/null +++ b/__tests__/tests/pages/AuthSettings.jsx @@ -0,0 +1,29 @@ +import React from 'react'; +import { mount } from 'enzyme'; +import AuthSettings from '../../../src/pages/AuthSettings'; + +describe('', () => { + let pageWrapper; + let pageSections; + let title; + + beforeEach(() => { + pageWrapper = mount(); + pageSections = pageWrapper.find('PageSection'); + title = pageWrapper.find('Title'); + }); + + afterEach(() => { + pageWrapper.unmount(); + }); + + test('initially renders without crashing', () => { + expect(pageWrapper.length).toBe(1); + expect(pageSections.length).toBe(2); + expect(title.length).toBe(1); + expect(title.props().size).toBe('2xl'); + pageSections.forEach(section => { + expect(section.props().variant).toBeDefined(); + }); + }); +}); diff --git a/__tests__/tests/pages/CredentialTypes.jsx b/__tests__/tests/pages/CredentialTypes.jsx new file mode 100644 index 0000000000..96a46657e0 --- /dev/null +++ b/__tests__/tests/pages/CredentialTypes.jsx @@ -0,0 +1,29 @@ +import React from 'react'; +import { mount } from 'enzyme'; +import CredentialTypes from '../../../src/pages/CredentialTypes'; + +describe('', () => { + let pageWrapper; + let pageSections; + let title; + + beforeEach(() => { + pageWrapper = mount(); + pageSections = pageWrapper.find('PageSection'); + title = pageWrapper.find('Title'); + }); + + afterEach(() => { + pageWrapper.unmount(); + }); + + test('initially renders without crashing', () => { + expect(pageWrapper.length).toBe(1); + expect(pageSections.length).toBe(2); + expect(title.length).toBe(1); + expect(title.props().size).toBe('2xl'); + pageSections.forEach(section => { + expect(section.props().variant).toBeDefined(); + }); + }); +}); diff --git a/__tests__/tests/pages/Credentials.jsx b/__tests__/tests/pages/Credentials.jsx new file mode 100644 index 0000000000..3ef7699ff7 --- /dev/null +++ b/__tests__/tests/pages/Credentials.jsx @@ -0,0 +1,29 @@ +import React from 'react'; +import { mount } from 'enzyme'; +import Credentials from '../../../src/pages/Credentials'; + +describe('', () => { + let pageWrapper; + let pageSections; + let title; + + beforeEach(() => { + pageWrapper = mount(); + pageSections = pageWrapper.find('PageSection'); + title = pageWrapper.find('Title'); + }); + + afterEach(() => { + pageWrapper.unmount(); + }); + + test('initially renders without crashing', () => { + expect(pageWrapper.length).toBe(1); + expect(pageSections.length).toBe(2); + expect(title.length).toBe(1); + expect(title.props().size).toBe('2xl'); + pageSections.forEach(section => { + expect(section.props().variant).toBeDefined(); + }); + }); +}); diff --git a/__tests__/tests/pages/Dashboard.jsx b/__tests__/tests/pages/Dashboard.jsx new file mode 100644 index 0000000000..5f73b24942 --- /dev/null +++ b/__tests__/tests/pages/Dashboard.jsx @@ -0,0 +1,29 @@ +import React from 'react'; +import { mount } from 'enzyme'; +import Dashboard from '../../../src/pages/Dashboard'; + +describe('', () => { + let pageWrapper; + let pageSections; + let title; + + beforeEach(() => { + pageWrapper = mount(); + pageSections = pageWrapper.find('PageSection'); + title = pageWrapper.find('Title'); + }); + + afterEach(() => { + pageWrapper.unmount(); + }); + + test('initially renders without crashing', () => { + expect(pageWrapper.length).toBe(1); + expect(pageSections.length).toBe(2); + expect(title.length).toBe(1); + expect(title.props().size).toBe('2xl'); + pageSections.forEach(section => { + expect(section.props().variant).toBeDefined(); + }); + }); +}); diff --git a/__tests__/tests/pages/InstanceGroups.jsx b/__tests__/tests/pages/InstanceGroups.jsx new file mode 100644 index 0000000000..221c0bd1ab --- /dev/null +++ b/__tests__/tests/pages/InstanceGroups.jsx @@ -0,0 +1,29 @@ +import React from 'react'; +import { mount } from 'enzyme'; +import InstanceGroups from '../../../src/pages/InstanceGroups'; + +describe('', () => { + let pageWrapper; + let pageSections; + let title; + + beforeEach(() => { + pageWrapper = mount(); + pageSections = pageWrapper.find('PageSection'); + title = pageWrapper.find('Title'); + }); + + afterEach(() => { + pageWrapper.unmount(); + }); + + test('initially renders without crashing', () => { + expect(pageWrapper.length).toBe(1); + expect(pageSections.length).toBe(2); + expect(title.length).toBe(1); + expect(title.props().size).toBe('2xl'); + pageSections.forEach(section => { + expect(section.props().variant).toBeDefined(); + }); + }); +}); diff --git a/__tests__/tests/pages/Inventories.jsx b/__tests__/tests/pages/Inventories.jsx new file mode 100644 index 0000000000..3be713eda5 --- /dev/null +++ b/__tests__/tests/pages/Inventories.jsx @@ -0,0 +1,29 @@ +import React from 'react'; +import { mount } from 'enzyme'; +import Inventories from '../../../src/pages/Inventories'; + +describe('', () => { + let pageWrapper; + let pageSections; + let title; + + beforeEach(() => { + pageWrapper = mount(); + pageSections = pageWrapper.find('PageSection'); + title = pageWrapper.find('Title'); + }); + + afterEach(() => { + pageWrapper.unmount(); + }); + + test('initially renders without crashing', () => { + expect(pageWrapper.length).toBe(1); + expect(pageSections.length).toBe(2); + expect(title.length).toBe(1); + expect(title.props().size).toBe('2xl'); + pageSections.forEach(section => { + expect(section.props().variant).toBeDefined(); + }); + }); +}); diff --git a/__tests__/tests/pages/InventoryScripts.jsx b/__tests__/tests/pages/InventoryScripts.jsx new file mode 100644 index 0000000000..0801078d3a --- /dev/null +++ b/__tests__/tests/pages/InventoryScripts.jsx @@ -0,0 +1,29 @@ +import React from 'react'; +import { mount } from 'enzyme'; +import InventoryScripts from '../../../src/pages/InventoryScripts'; + +describe('', () => { + let pageWrapper; + let pageSections; + let title; + + beforeEach(() => { + pageWrapper = mount(); + pageSections = pageWrapper.find('PageSection'); + title = pageWrapper.find('Title'); + }); + + afterEach(() => { + pageWrapper.unmount(); + }); + + test('initially renders without crashing', () => { + expect(pageWrapper.length).toBe(1); + expect(pageSections.length).toBe(2); + expect(title.length).toBe(1); + expect(title.props().size).toBe('2xl'); + pageSections.forEach(section => { + expect(section.props().variant).toBeDefined(); + }); + }); +}); diff --git a/__tests__/tests/pages/Jobs.jsx b/__tests__/tests/pages/Jobs.jsx new file mode 100644 index 0000000000..88142fb517 --- /dev/null +++ b/__tests__/tests/pages/Jobs.jsx @@ -0,0 +1,29 @@ +import React from 'react'; +import { mount } from 'enzyme'; +import Jobs from '../../../src/pages/Jobs'; + +describe('', () => { + let pageWrapper; + let pageSections; + let title; + + beforeEach(() => { + pageWrapper = mount(); + pageSections = pageWrapper.find('PageSection'); + title = pageWrapper.find('Title'); + }); + + afterEach(() => { + pageWrapper.unmount(); + }); + + test('initially renders without crashing', () => { + expect(pageWrapper.length).toBe(1); + expect(pageSections.length).toBe(2); + expect(title.length).toBe(1); + expect(title.props().size).toBe('2xl'); + pageSections.forEach(section => { + expect(section.props().variant).toBeDefined(); + }); + }); +}); diff --git a/__tests__/tests/pages/JobsSettings.jsx b/__tests__/tests/pages/JobsSettings.jsx new file mode 100644 index 0000000000..a86479b896 --- /dev/null +++ b/__tests__/tests/pages/JobsSettings.jsx @@ -0,0 +1,29 @@ +import React from 'react'; +import { mount } from 'enzyme'; +import JobsSettings from '../../../src/pages/JobsSettings'; + +describe('', () => { + let pageWrapper; + let pageSections; + let title; + + beforeEach(() => { + pageWrapper = mount(); + pageSections = pageWrapper.find('PageSection'); + title = pageWrapper.find('Title'); + }); + + afterEach(() => { + pageWrapper.unmount(); + }); + + test('initially renders without crashing', () => { + expect(pageWrapper.length).toBe(1); + expect(pageSections.length).toBe(2); + expect(title.length).toBe(1); + expect(title.props().size).toBe('2xl'); + pageSections.forEach(section => { + expect(section.props().variant).toBeDefined(); + }); + }); +}); diff --git a/__tests__/tests/pages/License.jsx b/__tests__/tests/pages/License.jsx new file mode 100644 index 0000000000..ae52e60310 --- /dev/null +++ b/__tests__/tests/pages/License.jsx @@ -0,0 +1,29 @@ +import React from 'react'; +import { mount } from 'enzyme'; +import License from '../../../src/pages/License'; + +describe('', () => { + let pageWrapper; + let pageSections; + let title; + + beforeEach(() => { + pageWrapper = mount(); + pageSections = pageWrapper.find('PageSection'); + title = pageWrapper.find('Title'); + }); + + afterEach(() => { + pageWrapper.unmount(); + }); + + test('initially renders without crashing', () => { + expect(pageWrapper.length).toBe(1); + expect(pageSections.length).toBe(2); + expect(title.length).toBe(1); + expect(title.props().size).toBe('2xl'); + pageSections.forEach(section => { + expect(section.props().variant).toBeDefined(); + }); + }); +}); diff --git a/__tests__/tests/LoginPage.test.jsx b/__tests__/tests/pages/Login.jsx similarity index 97% rename from __tests__/tests/LoginPage.test.jsx rename to __tests__/tests/pages/Login.jsx index 63675a98ab..bbd3425373 100644 --- a/__tests__/tests/LoginPage.test.jsx +++ b/__tests__/tests/pages/Login.jsx @@ -1,9 +1,9 @@ import React from 'react'; import { MemoryRouter } from 'react-router-dom'; import { mount, shallow } from 'enzyme'; -import { asyncFlush } from '../../jest.setup'; -import LoginPage from '../../src/pages/Login'; -import api from '../../src/api'; +import { asyncFlush } from '../../../jest.setup'; +import LoginPage from '../../../src/pages/Login'; +import api from '../../../src/api'; const LOGIN_ERROR_MESSAGE = 'Invalid username or password. Please try again.'; diff --git a/__tests__/tests/pages/ManagementJobs.jsx b/__tests__/tests/pages/ManagementJobs.jsx new file mode 100644 index 0000000000..0d6b4214f7 --- /dev/null +++ b/__tests__/tests/pages/ManagementJobs.jsx @@ -0,0 +1,29 @@ +import React from 'react'; +import { mount } from 'enzyme'; +import ManagementJobs from '../../../src/pages/ManagementJobs'; + +describe('', () => { + let pageWrapper; + let pageSections; + let title; + + beforeEach(() => { + pageWrapper = mount(); + pageSections = pageWrapper.find('PageSection'); + title = pageWrapper.find('Title'); + }); + + afterEach(() => { + pageWrapper.unmount(); + }); + + test('initially renders without crashing', () => { + expect(pageWrapper.length).toBe(1); + expect(pageSections.length).toBe(2); + expect(title.length).toBe(1); + expect(title.props().size).toBe('2xl'); + pageSections.forEach(section => { + expect(section.props().variant).toBeDefined(); + }); + }); +}); diff --git a/__tests__/tests/pages/NotifcationTemplates.jsx b/__tests__/tests/pages/NotifcationTemplates.jsx new file mode 100644 index 0000000000..34e5e3cdcf --- /dev/null +++ b/__tests__/tests/pages/NotifcationTemplates.jsx @@ -0,0 +1,29 @@ +import React from 'react'; +import { mount } from 'enzyme'; +import NotificationTemplates from '../../../src/pages/NotificationTemplates'; + +describe('', () => { + let pageWrapper; + let pageSections; + let title; + + beforeEach(() => { + pageWrapper = mount(); + pageSections = pageWrapper.find('PageSection'); + title = pageWrapper.find('Title'); + }); + + afterEach(() => { + pageWrapper.unmount(); + }); + + test('initially renders without crashing', () => { + expect(pageWrapper.length).toBe(1); + expect(pageSections.length).toBe(2); + expect(title.length).toBe(1); + expect(title.props().size).toBe('2xl'); + pageSections.forEach(section => { + expect(section.props().variant).toBeDefined(); + }); + }); +}); diff --git a/__tests__/tests/pages/Organizations.jsx b/__tests__/tests/pages/Organizations.jsx new file mode 100644 index 0000000000..ac646420ec --- /dev/null +++ b/__tests__/tests/pages/Organizations.jsx @@ -0,0 +1,54 @@ +import React from 'react'; +import { mount } from 'enzyme'; +import Organizations from '../../../src/pages/Organizations'; + +describe('', () => { + let pageWrapper; + let pageSections; + let title; + let gallery; + let galleryItems; + let orgCards; + + const orgs = [ + { id: 1, name: 'org 1' }, + { id: 2, name: 'org 2' }, + { id: 3, name: 'org 3' } + ]; + + const findOrgCards = () => { + galleryItems = pageWrapper.find('GalleryItem'); + orgCards = pageWrapper.find('OrganizationCard'); + }; + + beforeEach(() => { + pageWrapper = mount(); + pageSections = pageWrapper.find('PageSection'); + title = pageWrapper.find('Title'); + gallery = pageWrapper.find('Gallery'); + findOrgCards(); + }); + + afterEach(() => { + pageWrapper.unmount(); + }); + + test('initially renders without crashing', () => { + expect(pageWrapper.length).toBe(1); + expect(pageSections.length).toBe(2); + expect(title.length).toBe(1); + expect(title.props().size).toBe('2xl'); + pageSections.forEach(section => { + expect(section.props().variant).toBeDefined(); + }); + expect(gallery.length).toBe(1); + // by default, no galleryItems or orgCards + expect(galleryItems.length).toBe(0); + expect(orgCards.length).toBe(0); + // will render all orgCards if state is set + pageWrapper.setState({ organizations: orgs }); + findOrgCards(); + expect(galleryItems.length).toBe(3); + expect(orgCards.length).toBe(3); + }); +}); diff --git a/__tests__/tests/pages/Portal.jsx b/__tests__/tests/pages/Portal.jsx new file mode 100644 index 0000000000..a1c3398bef --- /dev/null +++ b/__tests__/tests/pages/Portal.jsx @@ -0,0 +1,29 @@ +import React from 'react'; +import { mount } from 'enzyme'; +import Portal from '../../../src/pages/Portal'; + +describe('', () => { + let pageWrapper; + let pageSections; + let title; + + beforeEach(() => { + pageWrapper = mount(); + pageSections = pageWrapper.find('PageSection'); + title = pageWrapper.find('Title'); + }); + + afterEach(() => { + pageWrapper.unmount(); + }); + + test('initially renders without crashing', () => { + expect(pageWrapper.length).toBe(1); + expect(pageSections.length).toBe(2); + expect(title.length).toBe(1); + expect(title.props().size).toBe('2xl'); + pageSections.forEach(section => { + expect(section.props().variant).toBeDefined(); + }); + }); +}); diff --git a/__tests__/tests/pages/Projects.jsx b/__tests__/tests/pages/Projects.jsx new file mode 100644 index 0000000000..a79d98b036 --- /dev/null +++ b/__tests__/tests/pages/Projects.jsx @@ -0,0 +1,29 @@ +import React from 'react'; +import { mount } from 'enzyme'; +import Projects from '../../../src/pages/Projects'; + +describe('', () => { + let pageWrapper; + let pageSections; + let title; + + beforeEach(() => { + pageWrapper = mount(); + pageSections = pageWrapper.find('PageSection'); + title = pageWrapper.find('Title'); + }); + + afterEach(() => { + pageWrapper.unmount(); + }); + + test('initially renders without crashing', () => { + expect(pageWrapper.length).toBe(1); + expect(pageSections.length).toBe(2); + expect(title.length).toBe(1); + expect(title.props().size).toBe('2xl'); + pageSections.forEach(section => { + expect(section.props().variant).toBeDefined(); + }); + }); +}); diff --git a/__tests__/tests/pages/Schedules.jsx b/__tests__/tests/pages/Schedules.jsx new file mode 100644 index 0000000000..b9b8ccf6d3 --- /dev/null +++ b/__tests__/tests/pages/Schedules.jsx @@ -0,0 +1,29 @@ +import React from 'react'; +import { mount } from 'enzyme'; +import Schedules from '../../../src/pages/Schedules'; + +describe('', () => { + let pageWrapper; + let pageSections; + let title; + + beforeEach(() => { + pageWrapper = mount(); + pageSections = pageWrapper.find('PageSection'); + title = pageWrapper.find('Title'); + }); + + afterEach(() => { + pageWrapper.unmount(); + }); + + test('initially renders without crashing', () => { + expect(pageWrapper.length).toBe(1); + expect(pageSections.length).toBe(2); + expect(title.length).toBe(1); + expect(title.props().size).toBe('2xl'); + pageSections.forEach(section => { + expect(section.props().variant).toBeDefined(); + }); + }); +}); diff --git a/__tests__/tests/pages/SystemSettings.jsx b/__tests__/tests/pages/SystemSettings.jsx new file mode 100644 index 0000000000..6539032606 --- /dev/null +++ b/__tests__/tests/pages/SystemSettings.jsx @@ -0,0 +1,29 @@ +import React from 'react'; +import { mount } from 'enzyme'; +import SystemSettings from '../../../src/pages/SystemSettings'; + +describe('', () => { + let pageWrapper; + let pageSections; + let title; + + beforeEach(() => { + pageWrapper = mount(); + pageSections = pageWrapper.find('PageSection'); + title = pageWrapper.find('Title'); + }); + + afterEach(() => { + pageWrapper.unmount(); + }); + + test('initially renders without crashing', () => { + expect(pageWrapper.length).toBe(1); + expect(pageSections.length).toBe(2); + expect(title.length).toBe(1); + expect(title.props().size).toBe('2xl'); + pageSections.forEach(section => { + expect(section.props().variant).toBeDefined(); + }); + }); +}); diff --git a/__tests__/tests/pages/Teams.jsx b/__tests__/tests/pages/Teams.jsx new file mode 100644 index 0000000000..9d7c7e247a --- /dev/null +++ b/__tests__/tests/pages/Teams.jsx @@ -0,0 +1,29 @@ +import React from 'react'; +import { mount } from 'enzyme'; +import Teams from '../../../src/pages/Teams'; + +describe('', () => { + let pageWrapper; + let pageSections; + let title; + + beforeEach(() => { + pageWrapper = mount(); + pageSections = pageWrapper.find('PageSection'); + title = pageWrapper.find('Title'); + }); + + afterEach(() => { + pageWrapper.unmount(); + }); + + test('initially renders without crashing', () => { + expect(pageWrapper.length).toBe(1); + expect(pageSections.length).toBe(2); + expect(title.length).toBe(1); + expect(title.props().size).toBe('2xl'); + pageSections.forEach(section => { + expect(section.props().variant).toBeDefined(); + }); + }); +}); diff --git a/__tests__/tests/pages/Templates.jsx b/__tests__/tests/pages/Templates.jsx new file mode 100644 index 0000000000..42090f5a6b --- /dev/null +++ b/__tests__/tests/pages/Templates.jsx @@ -0,0 +1,29 @@ +import React from 'react'; +import { mount } from 'enzyme'; +import Templates from '../../../src/pages/Templates'; + +describe('', () => { + let pageWrapper; + let pageSections; + let title; + + beforeEach(() => { + pageWrapper = mount(); + pageSections = pageWrapper.find('PageSection'); + title = pageWrapper.find('Title'); + }); + + afterEach(() => { + pageWrapper.unmount(); + }); + + test('initially renders without crashing', () => { + expect(pageWrapper.length).toBe(1); + expect(pageSections.length).toBe(2); + expect(title.length).toBe(1); + expect(title.props().size).toBe('2xl'); + pageSections.forEach(section => { + expect(section.props().variant).toBeDefined(); + }); + }); +}); diff --git a/__tests__/tests/pages/UISettings.jsx b/__tests__/tests/pages/UISettings.jsx new file mode 100644 index 0000000000..57fcd8133c --- /dev/null +++ b/__tests__/tests/pages/UISettings.jsx @@ -0,0 +1,29 @@ +import React from 'react'; +import { mount } from 'enzyme'; +import UISettings from '../../../src/pages/UISettings'; + +describe('', () => { + let pageWrapper; + let pageSections; + let title; + + beforeEach(() => { + pageWrapper = mount(); + pageSections = pageWrapper.find('PageSection'); + title = pageWrapper.find('Title'); + }); + + afterEach(() => { + pageWrapper.unmount(); + }); + + test('initially renders without crashing', () => { + expect(pageWrapper.length).toBe(1); + expect(pageSections.length).toBe(2); + expect(title.length).toBe(1); + expect(title.props().size).toBe('2xl'); + pageSections.forEach(section => { + expect(section.props().variant).toBeDefined(); + }); + }); +}); diff --git a/__tests__/tests/pages/Users.jsx b/__tests__/tests/pages/Users.jsx new file mode 100644 index 0000000000..642d303185 --- /dev/null +++ b/__tests__/tests/pages/Users.jsx @@ -0,0 +1,29 @@ +import React from 'react'; +import { mount } from 'enzyme'; +import Users from '../../../src/pages/Users'; + +describe('', () => { + let pageWrapper; + let pageSections; + let title; + + beforeEach(() => { + pageWrapper = mount(); + pageSections = pageWrapper.find('PageSection'); + title = pageWrapper.find('Title'); + }); + + afterEach(() => { + pageWrapper.unmount(); + }); + + test('initially renders without crashing', () => { + expect(pageWrapper.length).toBe(1); + expect(pageSections.length).toBe(2); + expect(title.length).toBe(1); + expect(title.props().size).toBe('2xl'); + pageSections.forEach(section => { + expect(section.props().variant).toBeDefined(); + }); + }); +});