From 6581a1da7e47ae3762771595b6a12f7d9d30b655 Mon Sep 17 00:00:00 2001 From: Evan Purkhiser Date: Wed, 17 Jul 2019 15:36:05 -0700 Subject: [PATCH] ref(onobarding): Remove old onboarding experience --- .../sentry/app/components/createProject.jsx | 30 +- src/sentry/static/sentry/app/routes.jsx | 27 +- .../static/sentry/app/stores/hookStore.jsx | 5 - .../sentry/app/views/onboarding/configure.jsx | 115 -- .../app/views/onboarding/newProject.jsx | 14 - .../sentry/app/views/onboarding/platform.jsx | 3 +- .../sentry/app/views/onboarding/progress.jsx | 138 --- .../views/onboarding/projectSetup/index.jsx | 13 +- .../onboarding/projectSetup/setupChoices.jsx | 1 + .../sentry/app/views/onboarding/styles.jsx | 35 - .../sentry/app/views/onboarding/utils.js | 11 - .../sentry/app/views/onboarding/welcome.jsx | 9 +- .../sentry/app/views/onboarding/wizard.jsx | 35 - .../sentry/app/views/onboarding/wizardNew.jsx | 1 + .../app/views/projectInstall/newProject.jsx | 16 +- src/sentry/static/sentry/less/onboarding.less | 112 -- src/sentry/static/sentry/less/sentry.less | 1 - tests/acceptance/test_onboarding.py | 40 +- .../__snapshots__/createProject.spec.jsx.snap | 3 - .../__snapshots__/configure.spec.jsx.snap | 986 ------------------ .../__snapshots__/progress.spec.jsx.snap | 149 --- .../__snapshots__/wizard.spec.jsx.snap | 25 - .../spec/views/onboarding/configure.spec.jsx | 122 --- .../spec/views/onboarding/progress.spec.jsx | 74 -- .../js/spec/views/onboarding/wizard.spec.jsx | 37 - .../__snapshots__/newProject.spec.jsx.snap | 25 +- 26 files changed, 67 insertions(+), 1960 deletions(-) delete mode 100644 src/sentry/static/sentry/app/views/onboarding/configure.jsx delete mode 100644 src/sentry/static/sentry/app/views/onboarding/newProject.jsx delete mode 100644 src/sentry/static/sentry/app/views/onboarding/progress.jsx delete mode 100644 src/sentry/static/sentry/app/views/onboarding/styles.jsx delete mode 100644 src/sentry/static/sentry/app/views/onboarding/utils.js delete mode 100644 src/sentry/static/sentry/app/views/onboarding/wizard.jsx delete mode 100644 src/sentry/static/sentry/less/onboarding.less delete mode 100644 tests/js/spec/views/onboarding/__snapshots__/configure.spec.jsx.snap delete mode 100644 tests/js/spec/views/onboarding/__snapshots__/progress.spec.jsx.snap delete mode 100644 tests/js/spec/views/onboarding/__snapshots__/wizard.spec.jsx.snap delete mode 100644 tests/js/spec/views/onboarding/configure.spec.jsx delete mode 100644 tests/js/spec/views/onboarding/progress.spec.jsx delete mode 100644 tests/js/spec/views/onboarding/wizard.spec.jsx diff --git a/src/sentry/static/sentry/app/components/createProject.jsx b/src/sentry/static/sentry/app/components/createProject.jsx index 07606b3dbc15..187cb8f7229c 100644 --- a/src/sentry/static/sentry/app/components/createProject.jsx +++ b/src/sentry/static/sentry/app/components/createProject.jsx @@ -9,7 +9,6 @@ import {openCreateTeamModal} from 'app/actionCreators/modal'; import {t} from 'app/locale'; import Alert from 'app/components/alert'; import Button from 'app/components/button'; -import HookStore from 'app/stores/hookStore'; import PageHeading from 'app/components/pageHeading'; import PlatformIconTile from 'app/components/platformIconTile'; import PlatformPicker from 'app/components/platformPicker'; @@ -28,12 +27,6 @@ class CreateProject extends React.Component { api: PropTypes.object, teams: PropTypes.arrayOf(SentryTypes.Team), organization: SentryTypes.Organization, - nextStepUrl: PropTypes.func, - }; - - static defaultProps = { - nextStepUrl: ({slug, projectSlug, platform}) => - `/onboarding/${slug}/${projectSlug}/configure/${platform}`, }; static contextTypes = { @@ -61,7 +54,7 @@ class CreateProject extends React.Component { createProject = e => { e.preventDefault(); - const {organization, api, nextStepUrl} = this.props; + const {organization, api} = this.props; const {projectName, platform, team} = this.state; const {slug} = organization; @@ -71,7 +64,7 @@ class CreateProject extends React.Component { Sentry.withScope(scope => { scope.setExtra('props', this.props); scope.setExtra('state', this.state); - Sentry.captureMessage('Onboarding no project name'); + Sentry.captureMessage('No project name'); }); } @@ -84,19 +77,12 @@ class CreateProject extends React.Component { success: data => { ProjectActions.createSuccess(data); - const urlData = { - slug: organization.slug, - projectSlug: data.slug, - platform: platform || 'other', - }; - - const defaultNextUrl = nextStepUrl(urlData); - const hookNextUrl = - organization.projects.length === 0 && - HookStore.get('utils:onboarding-survey-url').length && - HookStore.get('utils:onboarding-survey-url')[0](urlData, organization); + const platformKey = platform || 'other'; + const nextUrl = `/${organization.slug}/${ + data.slug + }/getting-started/${platformKey}/`; - browserHistory.push(hookNextUrl || defaultNextUrl); + browserHistory.push(nextUrl); }, error: err => { this.setState({ @@ -112,7 +98,7 @@ class CreateProject extends React.Component { scope.setExtra('err', err); scope.setExtra('props', this.props); scope.setExtra('state', this.state); - Sentry.captureMessage('Onboarding project creation failed'); + Sentry.captureMessage('Project creation failed'); }); } }, diff --git a/src/sentry/static/sentry/app/routes.jsx b/src/sentry/static/sentry/app/routes.jsx index ede1a7a303ed..a4d58b68e95b 100644 --- a/src/sentry/static/sentry/app/routes.jsx +++ b/src/sentry/static/sentry/app/routes.jsx @@ -45,12 +45,6 @@ const OrganizationMembersView = HookOrDefault({ import(/* webpackChunkName: "OrganizationMembers" */ 'app/views/settings/organizationMembers'), }); -const OnboardingNewProjectView = HookOrDefault({ - hookName: 'component:onboarding-new-project', - defaultComponentPromise: () => - import(/* webpackChunkName: "OnboardingNewProject" */ 'app/views/onboarding/newProject'), -}); - function routes() { const accountSettingsRoutes = ( @@ -786,9 +780,7 @@ function routes() { /> - {/* The current (old) version of the onboarding experience does not - route to anything here. So even though this is new, the route can - live where it will eventually live. */} + @@ -796,23 +788,6 @@ function routes() { } component={errorHandler(LazyLoad)} /> - {/* TODO(epurkhiser): Old style onboarding experience routes. To be removed in the future */} - - import(/* webpackChunkName: "OnboardingWizard" */ 'app/views/onboarding/wizard') - } - component={errorHandler(LazyLoad)} - > - - - import(/* webpackChunkName: "OnboardingConfigure" */ 'app/views/onboarding/configure') - } - component={errorHandler(LazyLoad)} - /> - {hook('routes:onboarding')} - diff --git a/src/sentry/static/sentry/app/stores/hookStore.jsx b/src/sentry/static/sentry/app/stores/hookStore.jsx index c65f94ba5368..d667c5a46027 100644 --- a/src/sentry/static/sentry/app/stores/hookStore.jsx +++ b/src/sentry/static/sentry/app/stores/hookStore.jsx @@ -6,7 +6,6 @@ const validHookNames = new Set([ // Additional routes 'routes', 'routes:admin', - 'routes:onboarding', 'routes:organization', 'routes:organization-root', @@ -40,11 +39,7 @@ const validHookNames = new Set([ 'sidebar:item-label', // Onboarding experience - // TODO(epurkhiser): These all should become less getsentry specific - 'utils:onboarding-survey-url', - 'sidebar:onboarding-assets', 'onboarding:invite-members', - 'component:onboarding-new-project', // Used to provide a component for integration features. 'integrations:feature-gates', diff --git a/src/sentry/static/sentry/app/views/onboarding/configure.jsx b/src/sentry/static/sentry/app/views/onboarding/configure.jsx deleted file mode 100644 index 000dfad5aa50..000000000000 --- a/src/sentry/static/sentry/app/views/onboarding/configure.jsx +++ /dev/null @@ -1,115 +0,0 @@ -import {browserHistory} from 'react-router'; -import React from 'react'; -import styled from 'react-emotion'; - -import {t} from 'app/locale'; -import {trackAnalyticsEvent} from 'app/utils/analytics'; -import Button from 'app/components/button'; -import ProjectContext from 'app/views/projects/projectContext'; -import ProjectInstallPlatform from 'app/views/projectInstall/platform'; -import SentryTypes from 'app/sentryTypes'; -import withOrganization from 'app/utils/withOrganization'; - -import CreateSampleEventButton from './createSampleEventButton'; - -class Configure extends React.Component { - static propTypes = { - organization: SentryTypes.Organization, - }; - - state = { - hasSentRealEvent: false, - }; - - componentDidMount() { - const {organization, params} = this.props; - - trackAnalyticsEvent({ - eventKey: 'onboarding.configure_viewed', - eventName: 'Viewed Onboarding Installation Instructions', - organization_id: organization.id, - project: params.projectId, - platform: params.platform, - }); - - this.sentRealEvent(); - } - - get project() { - return this.props.organization.projects.find( - p => p.slug === this.props.params.projectId - ); - } - - sentRealEvent() { - const project = this.project; - let hasSentRealEvent = false; - if (project && project.firstEvent) { - hasSentRealEvent = true; - } - this.setState({hasSentRealEvent}); - } - - redirectUrl() { - const {orgId} = this.props.params; - - const url = `/organizations/${orgId}/issues/#welcome`; - browserHistory.push(url); - } - - submit = () => { - const {organization} = this.props; - const {projectId} = this.props.params; - - trackAnalyticsEvent({ - eventKey: 'onboarding.complete', - eventName: 'Completed Onboarding Installation Instructions', - organization_id: organization.id, - projectId, - }); - this.redirectUrl(); - }; - - render() { - const {orgId, projectId} = this.props.params; - const {hasSentRealEvent} = this.state; - - return ( -
-
-

- {t('Configure your application')} - {!hasSentRealEvent && ( -
- - {t('Or Create a Sample Event')} - -
- )} -

- - - - - - -
-
- ); - } -} - -const DoneButton = styled('div')` - display: grid; - grid-template-columns: max-content; - place-content: end; - margin-bottom: 20px; -`; - -export default withOrganization(Configure); diff --git a/src/sentry/static/sentry/app/views/onboarding/newProject.jsx b/src/sentry/static/sentry/app/views/onboarding/newProject.jsx deleted file mode 100644 index dfc43432d077..000000000000 --- a/src/sentry/static/sentry/app/views/onboarding/newProject.jsx +++ /dev/null @@ -1,14 +0,0 @@ -import React from 'react'; - -import CreateProject from 'app/components/createProject'; - -const NewProject = props => ( - - `/onboarding/${slug}/${projectSlug}/configure/${platform}/` - } - /> -); - -export default NewProject; diff --git a/src/sentry/static/sentry/app/views/onboarding/platform.jsx b/src/sentry/static/sentry/app/views/onboarding/platform.jsx index 7d4ce63b5d01..0850c32c9e07 100644 --- a/src/sentry/static/sentry/app/views/onboarding/platform.jsx +++ b/src/sentry/static/sentry/app/views/onboarding/platform.jsx @@ -46,7 +46,7 @@ class OnboardingPlatform extends React.Component { progressing: false, }; - componentDidUpdate(prevProps, prevState) { + componentDidUpdate(prevProps) { if (prevProps.active && !this.props.active) { // eslint-disable-next-line react/no-did-update-set-state this.setState({progressing: false}); @@ -144,6 +144,7 @@ class OnboardingPlatform extends React.Component { setPlatform={this.handleSetPlatform} /> diff --git a/src/sentry/static/sentry/app/views/onboarding/wizard.jsx b/src/sentry/static/sentry/app/views/onboarding/wizard.jsx deleted file mode 100644 index 0648078bf0cb..000000000000 --- a/src/sentry/static/sentry/app/views/onboarding/wizard.jsx +++ /dev/null @@ -1,35 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; -import DocumentTitle from 'react-document-title'; -import styled from 'react-emotion'; - -import ProgressNodes from 'app/views/onboarding/progress'; - -class OnboardingWizard extends React.Component { - static contextTypes = { - organization: PropTypes.object, - }; - - render() { - return ( - -
- -
- -
{this.props.children}
-
-
-
- ); - } -} - -const OnboardingBackground = styled('div')` - width: 100%; - height: 100%; - min-height: 100vh; - background: #fff; -`; - -export default OnboardingWizard; diff --git a/src/sentry/static/sentry/app/views/onboarding/wizardNew.jsx b/src/sentry/static/sentry/app/views/onboarding/wizardNew.jsx index 52e2e329bac8..4b5b70648f13 100644 --- a/src/sentry/static/sentry/app/views/onboarding/wizardNew.jsx +++ b/src/sentry/static/sentry/app/views/onboarding/wizardNew.jsx @@ -155,6 +155,7 @@ class OnboardingWizard extends React.Component { return visibleSteps.map((step, index) => ( diff --git a/src/sentry/static/sentry/app/views/projectInstall/newProject.jsx b/src/sentry/static/sentry/app/views/projectInstall/newProject.jsx index 1083a9ccc51e..49f36505227c 100644 --- a/src/sentry/static/sentry/app/views/projectInstall/newProject.jsx +++ b/src/sentry/static/sentry/app/views/projectInstall/newProject.jsx @@ -3,29 +3,19 @@ import React from 'react'; import styled from 'react-emotion'; import CreateProject from 'app/components/createProject'; -import SentryTypes from 'app/sentryTypes'; import space from 'app/styles/space'; -import withOrganization from 'app/utils/withOrganization'; -const NewProject = ({organization}) => ( +const NewProject = () => (
- - `/${slug}/${projectSlug}/getting-started/${platform}/` - } - /> +
); -NewProject.propTypes = { - organization: SentryTypes.Organization.isRequired, -}; - const Container = styled('div')` flex: 1; background: #fff; @@ -36,4 +26,4 @@ const Content = styled('div')` margin-top: ${space(3)}; `; -export default withOrganization(NewProject); +export default NewProject; diff --git a/src/sentry/static/sentry/less/onboarding.less b/src/sentry/static/sentry/less/onboarding.less deleted file mode 100644 index 56bbe6aa57f9..000000000000 --- a/src/sentry/static/sentry/less/onboarding.less +++ /dev/null @@ -1,112 +0,0 @@ -@onboarding-sidebar-width: 300px; - -.onboarding-container { - margin-left: @onboarding-sidebar-width; - - max-width: 800px + @onboarding-sidebar-width; - margin-top: 30px; - - @media (max-width: @screen-sm-max) { - margin-left: 0; - } - - .step-container { - padding: 0 40px; - } - - // Awaiting event - - .awaiting-event { - background: rgba(255, 255, 255, 0.9); - box-shadow: 0 -1px 0 rgba(0, 0, 0, 0.1); - padding: 20px 0; - position: sticky; - bottom: 0; - .clearfix; - } - - .wrap { - position: relative; - } - - .waiting-text { - padding-right: 10px; - padding-left: 80px; - position: relative; - margin-right: 200px; - - h3 { - margin: 5px 0 0; - } - } - - .robot { - position: absolute; - left: 0; - top: -30px; - padding-bottom: 5px; - width: 70px; - height: 82px; - background: url(../images/sentry-robot.png); - background-size: cover; - - .eye { - display: block; - .square(4px); - border-radius: 6px; - position: absolute; - top: 21px; - left: 26px; - transform: translateZ(0); - - -webkit-animation: blink-eye 0.6s infinite; - -moz-animation: blink-eye 0.6s infinite; - -o-animation: blink-eye 0.6s infinite; - animation: blink-eye 0.6s infinite; - } - } - - .onboarding-sidebar { - width: 300px; - height: 100%; - position: fixed; - z-index: 10000; - top: 0; - left: 0; - color: whitesmoke; - background: url(../images/sentry-pattern-dark.png); - background-color: #3b3247; - background-size: 400px; - - @media (max-width: @screen-sm-max) { - display: none; - } - - .sentry-flag { - font-size: 24px; - line-height: 1; - width: 150px; - margin: 30px 0px; - background-color: #e03e2f; - padding: 14px 20px 11px; - } - - .stuck { - position: absolute; - bottom: 0px; - text-align: center; - width: 100%; - padding: 20px; - p, - a { - margin: 0; - color: @40; - } - - &:hover p, - a { - color: @30; - } - } - } -} diff --git a/src/sentry/static/sentry/less/sentry.less b/src/sentry/static/sentry/less/sentry.less index eaf7029a5a74..ea52742ed625 100644 --- a/src/sentry/static/sentry/less/sentry.less +++ b/src/sentry/static/sentry/less/sentry.less @@ -42,4 +42,3 @@ @import url('./group-similar.less'); @import url('./component-layouts'); @import url('./queryCount.less'); -@import url('./onboarding.less'); diff --git a/tests/acceptance/test_onboarding.py b/tests/acceptance/test_onboarding.py index 2dbc3dbe4519..1fc5fd1f9078 100644 --- a/tests/acceptance/test_onboarding.py +++ b/tests/acceptance/test_onboarding.py @@ -23,27 +23,35 @@ def setUp(self): ) self.login_as(self.user) - @mock.patch('sentry.models.ProjectKey.generate_api_key', - return_value='031667ea1758441f92c7995a428d2d14') + @mock.patch('sentry.models.ProjectKey.generate_api_key', return_value='test-dsn') def test_onboarding(self, generate_api_key): self.browser.get('/onboarding/%s/' % self.org.slug) - self.browser.wait_until('.onboarding-container') - self.browser.wait_until_not('.loading-indicator') - self.browser.snapshot(name='onboarding-choose-platform') - self.browser.click('[data-test-id="platform-javascript-angular"]') - self.browser.click('[data-test-id="create-project"]') + # Welcome step + self.browser.wait_until('[data-test-id="onboarding-step-welcome"]') + self.browser.snapshot(name='onboarding - welcome') - self.browser.wait_until('.onboarding-Configure') - self.browser.wait_until_not('.loading-indicator') + # Platform selection step + self.browser.click('[data-test-id="welcome-next"]') + self.browser.wait_until('[data-test-id="onboarding-step-select-platform"]') + self.browser.snapshot(name='onboarding - select platform') + + # Select and create node JS project + self.browser.click('[data-test-id="platform-node"]') + self.browser.click('[data-test-id="platform-select-next"]') + + # Project getting started + self.browser.wait_until('[data-test-id="onboarding-step-get-started"]') + self.browser.snapshot(name='onboarding - get started') + + # Verify project was created for org project = Project.objects.get(organization=self.org) - assert project.name == 'Angular' - assert project.platform == 'javascript-angular' + assert project.name == 'rowdy-tiger' + assert project.platform == 'node' - self.browser.snapshot(name='onboarding-configure-project') - self.browser.click('[data-test-id="configure-done"]') - self.browser.wait_until_not('.loading-indicator') + self.browser.click('[data-test-id="onboarding-getting-started-invite-members"]') + self.browser.snapshot(name='onboarding - invite members') - assert self.browser.element_exists('.robot') - assert self.browser.element_exists_by_test_id('install-instructions') + self.browser.click('[data-test-id="onboarding-getting-started-learn-more"]') + self.browser.snapshot(name='onboarding - learn more') diff --git a/tests/js/spec/components/__snapshots__/createProject.spec.jsx.snap b/tests/js/spec/components/__snapshots__/createProject.spec.jsx.snap index bbfac313639f..401f1fa4269a 100644 --- a/tests/js/spec/components/__snapshots__/createProject.spec.jsx.snap +++ b/tests/js/spec/components/__snapshots__/createProject.spec.jsx.snap @@ -98,7 +98,6 @@ exports[`CreateProject should deal with incorrect platform name if its provided "query": Object {}, } } - nextStepUrl={[Function]} organization={ Object { "access": Array [ @@ -1679,7 +1678,6 @@ exports[`CreateProject should fill in platform name if its provided by url 1`] = "query": Object {}, } } - nextStepUrl={[Function]} organization={ Object { "access": Array [ @@ -2669,7 +2667,6 @@ exports[`CreateProject should fill in project name if its empty when platform is "query": Object {}, } } - nextStepUrl={[Function]} organization={ Object { "access": Array [ diff --git a/tests/js/spec/views/onboarding/__snapshots__/configure.spec.jsx.snap b/tests/js/spec/views/onboarding/__snapshots__/configure.spec.jsx.snap deleted file mode 100644 index a17a884fd5b0..000000000000 --- a/tests/js/spec/views/onboarding/__snapshots__/configure.spec.jsx.snap +++ /dev/null @@ -1,986 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Configure should render correctly render() should render platform docs 1`] = ` - - -
-
-

- Configure your application -
- - - - - - - - - - -
-

- - - - - - - - - - - - - -
- - - - - - - - - - - - - -
- - - - - - - - - - - -
- - - - This is a quick getting started guide. For in-depth instructions - on integrating Sentry with - - - Node.js - - - , view - - - - - our complete documentation - - - - . - - - -
-
-
-
-
-
-
-
- -
- -
- -
- -
- - - - - - - - - - - - - - -
- - - - -
-
-
-
- - -`; diff --git a/tests/js/spec/views/onboarding/__snapshots__/progress.spec.jsx.snap b/tests/js/spec/views/onboarding/__snapshots__/progress.spec.jsx.snap deleted file mode 100644 index d45cfa4e6910..000000000000 --- a/tests/js/spec/views/onboarding/__snapshots__/progress.spec.jsx.snap +++ /dev/null @@ -1,149 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`ProgressNodes render() should render step 0 if no projectId 1`] = ` -
-
- -
- - - - Create an organization in Sentry - - - - - - Tell us about your project - - - - - - Send an event from your application - - - -
-`; - -exports[`ProgressNodes render() should render step 1 if has projectId 1`] = ` -
-
- -
- - - - Create an organization in Sentry - - - - - - Tell us about your project - - - - - - Send an event from your application - - - -
-`; diff --git a/tests/js/spec/views/onboarding/__snapshots__/wizard.spec.jsx.snap b/tests/js/spec/views/onboarding/__snapshots__/wizard.spec.jsx.snap deleted file mode 100644 index 06fc647cd1e1..000000000000 --- a/tests/js/spec/views/onboarding/__snapshots__/wizard.spec.jsx.snap +++ /dev/null @@ -1,25 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`OnboardingWizard render() should render NotFound if no matching organization 1`] = ` - -
- -
- -
-
-
- -`; diff --git a/tests/js/spec/views/onboarding/configure.spec.jsx b/tests/js/spec/views/onboarding/configure.spec.jsx deleted file mode 100644 index ff2a0711e1dd..000000000000 --- a/tests/js/spec/views/onboarding/configure.spec.jsx +++ /dev/null @@ -1,122 +0,0 @@ -import React from 'react'; -import {mount} from 'enzyme'; - -import Configure from 'app/views/onboarding/configure'; -import ProjectsStore from 'app/stores/projectsStore'; - -describe('Configure should render correctly', function() { - let organization, project, team; - - beforeEach(function() { - MockApiClient.addMockResponse({ - url: '/projects/testOrg/project-slug/', - body: TestStubs.Project(), - }); - MockApiClient.addMockResponse({ - url: '/projects/testOrg/project-slug/events/', - body: {}, - }); - MockApiClient.addMockResponse({ - url: '/organizations/testOrg/users/', - body: [], - }); - MockApiClient.addMockResponse({ - url: '/projects/testOrg/project-slug/environments/', - body: [], - }); - MockApiClient.addMockResponse({ - url: '/projects/testOrg/project-slug/docs/node/', - body: {}, - }); - MockApiClient.addMockResponse({ - url: '/projects/testOrg/project-slug/docs/other/', - body: {}, - }); - ProjectsStore.loadInitialData([ - { - name: 'Test Project', - slug: 'project-slug', - id: 'testProject', - hasAccess: true, - isMember: true, - isBookmarked: false, - teams: [ - { - slug: 'coolteam', - id: 'coolid', - hasAccess: true, - }, - ], - }, - ]); - - project = { - name: 'Test Project', - slug: 'project-slug', - id: 'testProject', - hasAccess: true, - isBookmarked: false, - isMember: true, - teams: [ - { - id: 'coolteam', - slug: 'coolteam', - hasAccess: true, - }, - ], - }; - - team = { - id: 'coolteam', - slug: 'coolteam', - hasAccess: true, - projects: [ - { - name: 'Test Project', - slug: 'project-slug', - id: 'testProject', - }, - ], - }; - - organization = { - id: '1337', - slug: 'testOrg', - projects: [project], - teams: [team], - }; - }); - - afterEach(function() { - ProjectsStore.loadInitialData([]); - }); - - afterAll(function() { - MockApiClient.clearMockResponses(); - }); - - describe('render()', function() { - const baseProps = { - api: new MockApiClient(), - next: () => {}, - params: { - projectId: 'project-slug', - orgId: 'testOrg', - }, - }; - - it('should render platform docs', async function() { - const props = {...baseProps}; - props.params.platform = 'node'; - - const wrapper = mount( - , - TestStubs.routerContext([{organization}]) - ); - - await tick(); - wrapper.update(); - expect(wrapper).toMatchSnapshot(); - }); - }); -}); diff --git a/tests/js/spec/views/onboarding/progress.spec.jsx b/tests/js/spec/views/onboarding/progress.spec.jsx deleted file mode 100644 index 580a39341c3b..000000000000 --- a/tests/js/spec/views/onboarding/progress.spec.jsx +++ /dev/null @@ -1,74 +0,0 @@ -import React from 'react'; -import {shallow} from 'enzyme'; - -import ProgressNodes from 'app/views/onboarding/progress'; - -describe('ProgressNodes', function() { - describe('render()', function() { - const baseProps = { - params: { - projectId: '', - }, - }; - - it('should render step 0 if no projectId', function() { - const baseContext = { - context: { - organization: {id: '1337', slug: 'testOrg', experiments: {}}, - location: {pathname: 'http://onboarding/lol/', query: {}}, - }, - }; - const wrapper = shallow(, baseContext); - - expect(wrapper.find('[data-test-id="node"]')).toHaveLength(3); - expect(wrapper.find('[data-test-id="node"]').find({active: true})).toHaveLength(1); - expect( - wrapper - .find('[data-test-id="node"]') - .find({active: true}) - .find('[data-test-id="node-description"]') - .children() - .text() - ).toEqual('Tell us about your project'); - - expect(wrapper.find('[data-test-id="node"]').find({done: true})).toHaveLength(1); - - expect(wrapper).toMatchSnapshot(); - }); - - it('should render step 1 if has projectId', function() { - const baseContext = { - context: { - organization: {id: '1337', slug: 'testOrg', experiments: {}}, - location: { - pathname: 'http://onboarding/lol/projectSlug/configure/platform/', - query: {}, - }, - }, - }; - const props = { - ...baseProps, - params: { - projectId: 'my-cool-project', - }, - }; - - const wrapper = shallow(, baseContext); - - expect(wrapper.find('[data-test-id="node"]')).toHaveLength(3); - expect(wrapper.find('[data-test-id="node"]').find({active: true})).toHaveLength(1); - expect( - wrapper - .find('[data-test-id="node"]') - .find({active: true}) - .find('[data-test-id="node-description"]') - .children() - .text() - ).toEqual('Send an event from your application'); - - expect(wrapper.find('[data-test-id="node"]').find({done: true})).toHaveLength(2); - - expect(wrapper).toMatchSnapshot(); - }); - }); -}); diff --git a/tests/js/spec/views/onboarding/wizard.spec.jsx b/tests/js/spec/views/onboarding/wizard.spec.jsx deleted file mode 100644 index 9fd558f030de..000000000000 --- a/tests/js/spec/views/onboarding/wizard.spec.jsx +++ /dev/null @@ -1,37 +0,0 @@ -import React from 'react'; -import {shallow} from 'enzyme'; - -import {Client} from 'app/api'; -import OnboardingWizard from 'app/views/onboarding/wizard'; - -describe('OnboardingWizard', function() { - beforeEach(function() { - this.stubbedApiRequest = jest.spyOn(Client.prototype, 'request'); - }); - - afterEach(function() {}); - - describe('render()', function() { - const baseProps = { - location: {query: {}}, - params: { - projectId: '', - orgId: 'testOrg', - }, - }; - - it('should render NotFound if no matching organization', function() { - const props = { - ...baseProps, - params: { - orgId: 'my-cool-org', - }, - }; - - const wrapper = shallow(, { - organization: {id: '1337', slug: 'testOrg', experiments: {}}, - }); - expect(wrapper).toMatchSnapshot(); - }); - }); -}); diff --git a/tests/js/spec/views/projectInstall/__snapshots__/newProject.spec.jsx.snap b/tests/js/spec/views/projectInstall/__snapshots__/newProject.spec.jsx.snap index 77e180d7b721..27cf82efa847 100644 --- a/tests/js/spec/views/projectInstall/__snapshots__/newProject.spec.jsx.snap +++ b/tests/js/spec/views/projectInstall/__snapshots__/newProject.spec.jsx.snap @@ -1,17 +1,16 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`NewProjectPlatform render() should render 1`] = ` - + +
+ + + + +
+
`;