-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
215 additions
and
42 deletions.
There are no files selected for viewing
107 changes: 107 additions & 0 deletions
107
...ided-onboarding/src/components/landing_page/__snapshots__/guide_card_footer.test.tsx.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
71 changes: 71 additions & 0 deletions
71
packages/kbn-guided-onboarding/src/components/landing_page/guide_card_footer.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import React from 'react'; | ||
import { shallow } from 'enzyme'; | ||
|
||
import { GuideCardFooter, GuideCardFooterProps } from './guide_card_footer'; | ||
import { GuideState } from '../../types'; | ||
|
||
const defaultProps: GuideCardFooterProps = { | ||
guides: [], | ||
useCase: 'search', | ||
activateGuide: jest.fn(), | ||
}; | ||
|
||
const searchGuideState: GuideState = { | ||
guideId: 'search', | ||
status: 'not_started', | ||
steps: [ | ||
{ id: 'add_data', status: 'complete' }, | ||
{ id: 'browse_docs', status: 'in_progress' }, | ||
], | ||
isActive: true, | ||
}; | ||
describe('guide card footer', () => { | ||
describe('snapshots', () => { | ||
test('should render the footer when the guided onboarding has not started yet', async () => { | ||
const component = await shallow(<GuideCardFooter {...defaultProps} />); | ||
expect(component).toMatchSnapshot(); | ||
}); | ||
|
||
test('should render the footer when the guide has not started yet', async () => { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
yuliacech
Author
Contributor
|
||
const component = await shallow( | ||
<GuideCardFooter {...defaultProps} guides={[searchGuideState]} /> | ||
); | ||
expect(component).toMatchSnapshot(); | ||
}); | ||
|
||
test('should render the footer when the guide is in progress', async () => { | ||
const component = await shallow( | ||
<GuideCardFooter | ||
{...defaultProps} | ||
guides={[{ ...searchGuideState, status: 'in_progress' }]} | ||
/> | ||
); | ||
expect(component).toMatchSnapshot(); | ||
}); | ||
|
||
test('should render the footer when the guide is ready to complete', async () => { | ||
const component = await shallow( | ||
<GuideCardFooter | ||
{...defaultProps} | ||
guides={[{ ...searchGuideState, status: 'ready_to_complete' }]} | ||
/> | ||
); | ||
expect(component).toMatchSnapshot(); | ||
}); | ||
|
||
test('should render the footer when the guide has been completed', async () => { | ||
const component = await shallow( | ||
<GuideCardFooter {...defaultProps} guides={[{ ...searchGuideState, status: 'complete' }]} /> | ||
); | ||
expect(component).toMatchSnapshot(); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
What's the difference between this and the previous test? The generated DOM looks the same as well.