-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* [Maps] layer wizard select re-design * review feedback * tslint * add unit test * use smaller gutters * review feedback
- Loading branch information
Showing
22 changed files
with
304 additions
and
43 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
12 changes: 0 additions & 12 deletions
12
x-pack/plugins/maps/public/connected_components/add_layer_panel/_index.scss
This file was deleted.
Oops, something went wrong.
83 changes: 83 additions & 0 deletions
83
...ed_components/add_layer_panel/flyout_body/__snapshots__/layer_wizard_select.test.tsx.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
59 changes: 59 additions & 0 deletions
59
...maps/public/connected_components/add_layer_panel/flyout_body/layer_wizard_select.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,59 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
jest.mock('../../../classes/layers/layer_wizard_registry', () => ({})); | ||
|
||
import React from 'react'; | ||
import { shallow } from 'enzyme'; | ||
import { LayerWizardSelect } from './layer_wizard_select'; | ||
import { LAYER_WIZARD_CATEGORY } from '../../../../common/constants'; | ||
|
||
const defaultProps = { | ||
onSelect: () => {}, | ||
}; | ||
|
||
describe('LayerWizardSelect', () => { | ||
beforeAll(() => { | ||
require('../../../classes/layers/layer_wizard_registry').getLayerWizards = async () => { | ||
return [ | ||
{ | ||
categories: [LAYER_WIZARD_CATEGORY.ELASTICSEARCH], | ||
description: 'mock wizard without icon', | ||
renderWizard: () => { | ||
return <div />; | ||
}, | ||
title: 'wizard 1', | ||
}, | ||
{ | ||
categories: [LAYER_WIZARD_CATEGORY.SOLUTIONS], | ||
description: 'mock wizard with icon', | ||
icon: 'logoObservability', | ||
renderWizard: () => { | ||
return <div />; | ||
}, | ||
title: 'wizard 2', | ||
}, | ||
]; | ||
}; | ||
}); | ||
|
||
test('Should render layer select after layer wizards are loaded', async () => { | ||
const component = shallow(<LayerWizardSelect {...defaultProps} />); | ||
|
||
// Ensure all promises resolve | ||
await new Promise((resolve) => process.nextTick(resolve)); | ||
// Ensure the state changes are reflected | ||
component.update(); | ||
|
||
expect(component).toMatchSnapshot(); | ||
}); | ||
|
||
test('Should render loading screen before layer wizards are loaded', () => { | ||
const component = shallow(<LayerWizardSelect {...defaultProps} />); | ||
|
||
expect(component).toMatchSnapshot(); | ||
}); | ||
}); |
Oops, something went wrong.