Added more functional tests.

This commit is contained in:
orangemug
2020-05-31 15:33:09 +01:00
parent 3d4cc34a08
commit 8d3ad6b1a1
19 changed files with 1085 additions and 91 deletions
+1 -1
View File
@@ -24,7 +24,7 @@ class DebugModal extends React.Component {
const osmLat = Number.parseFloat(mapView.center.lat).toFixed(5);
return <Modal
data-wd-key="debug-modal"
data-wd-key="modal:debug"
isOpen={this.props.isOpen}
onOpenToggle={this.props.onOpenToggle}
title={'Debug'}
+1 -1
View File
@@ -61,7 +61,7 @@ class ExportModal extends React.Component {
render() {
return <Modal
data-wd-key="export-modal"
data-wd-key="modal:export"
isOpen={this.props.isOpen}
onOpenToggle={this.props.onOpenToggle}
title={'Export Style'}
+1 -1
View File
@@ -20,7 +20,7 @@ class LoadingModal extends React.Component {
render() {
return <Modal
data-wd-key="loading-modal"
data-wd-key="modal:loading"
isOpen={this.props.isOpen}
underlayClickExits={false}
underlayProps={{
+3 -3
View File
@@ -191,7 +191,7 @@ class OpenModal extends React.Component {
return (
<div>
<Modal
data-wd-key="open-modal"
data-wd-key="modal:open"
isOpen={this.props.isOpen}
onOpenToggle={() => this.onOpenToggle()}
title={'Open Style'}
@@ -212,7 +212,7 @@ class OpenModal extends React.Component {
</p>
<form onSubmit={this.onSubmitUrl}>
<UrlInput
data-wd-key="open-modal.url.input"
data-wd-key="modal:open.url.input"
type="text"
className="maputnik-input"
default="Enter URL..."
@@ -222,7 +222,7 @@ class OpenModal extends React.Component {
/>
<div>
<Button
data-wd-key="open-modal.url.button"
data-wd-key="modal:open.url.button"
type="submit"
className="maputnik-big-button"
disabled={this.state.styleUrl.length < 1}
+10 -10
View File
@@ -81,29 +81,29 @@ class SettingsModal extends React.Component {
const transition = this.props.mapStyle.transition || {};
return <Modal
data-wd-key="modal-settings"
data-wd-key="modal:settings"
isOpen={this.props.isOpen}
onOpenToggle={this.props.onOpenToggle}
title={'Style Settings'}
>
<div className="modal-settings">
<div className="modal:settings">
<InputBlock label={"Name"} fieldSpec={latest.$root.name}>
<StringInput {...inputProps}
data-wd-key="modal-settings.name"
data-wd-key="modal:settings.name"
value={this.props.mapStyle.name}
onChange={this.changeStyleProperty.bind(this, "name")}
/>
</InputBlock>
<InputBlock label={"Owner"} fieldSpec={{doc: "Owner ID of the style. Used by Mapbox or future style APIs."}}>
<StringInput {...inputProps}
data-wd-key="modal-settings.owner"
data-wd-key="modal:settings.owner"
value={this.props.mapStyle.owner}
onChange={this.changeStyleProperty.bind(this, "owner")}
/>
</InputBlock>
<InputBlock label={"Sprite URL"} fieldSpec={latest.$root.sprite}>
<UrlInput {...inputProps}
data-wd-key="modal-settings.sprite"
data-wd-key="modal:settings.sprite"
value={this.props.mapStyle.sprite}
onChange={this.changeStyleProperty.bind(this, "sprite")}
/>
@@ -111,7 +111,7 @@ class SettingsModal extends React.Component {
<InputBlock label={"Glyphs URL"} fieldSpec={latest.$root.glyphs}>
<UrlInput {...inputProps}
data-wd-key="modal-settings.glyphs"
data-wd-key="modal:settings.glyphs"
value={this.props.mapStyle.glyphs}
onChange={this.changeStyleProperty.bind(this, "glyphs")}
/>
@@ -122,7 +122,7 @@ class SettingsModal extends React.Component {
fieldSpec={fieldSpecAdditional.maputnik.mapbox_access_token}
>
<StringInput {...inputProps}
data-wd-key="modal-settings.maputnik:mapbox_access_token"
data-wd-key="modal:settings.maputnik:mapbox_access_token"
value={metadata['maputnik:mapbox_access_token']}
onChange={onChangeMetadataProperty.bind(this, "maputnik:mapbox_access_token")}
/>
@@ -133,7 +133,7 @@ class SettingsModal extends React.Component {
fieldSpec={fieldSpecAdditional.maputnik.maptiler_access_token}
>
<StringInput {...inputProps}
data-wd-key="modal-settings.maputnik:openmaptiles_access_token"
data-wd-key="modal:settings.maputnik:openmaptiles_access_token"
value={metadata['maputnik:openmaptiles_access_token']}
onChange={onChangeMetadataProperty.bind(this, "maputnik:openmaptiles_access_token")}
/>
@@ -144,7 +144,7 @@ class SettingsModal extends React.Component {
fieldSpec={fieldSpecAdditional.maputnik.thunderforest_access_token}
>
<StringInput {...inputProps}
data-wd-key="modal-settings.maputnik:thunderforest_access_token"
data-wd-key="modal:settings.maputnik:thunderforest_access_token"
value={metadata['maputnik:thunderforest_access_token']}
onChange={onChangeMetadataProperty.bind(this, "maputnik:thunderforest_access_token")}
/>
@@ -250,7 +250,7 @@ class SettingsModal extends React.Component {
fieldSpec={fieldSpecAdditional.maputnik.style_renderer}
>
<SelectInput {...inputProps}
data-wd-key="modal-settings.maputnik:renderer"
data-wd-key="modal:settings.maputnik:renderer"
options={[
['mbgljs', 'MapboxGL JS'],
['ol', 'Open Layers (experimental)'],
+1 -1
View File
@@ -100,7 +100,7 @@ class ShortcutsModal extends React.Component {
return <Modal
data-wd-key="shortcuts-modal"
data-wd-key="modal:shortcuts"
isOpen={this.props.isOpen}
onOpenToggle={this.props.onOpenToggle}
title={'Shortcuts'}
+1
View File
@@ -286,6 +286,7 @@ class SourcesModal extends React.Component {
const inputProps = { }
return <Modal
data-wd-key="modal:sources"
isOpen={this.props.isOpen}
onOpenToggle={this.props.onOpenToggle}
title={'Sources'}
+1 -1
View File
@@ -20,7 +20,7 @@ class SurveyModal extends React.Component {
render() {
return <Modal
data-wd-key="modal-survey"
data-wd-key="modal:survey"
isOpen={this.props.isOpen}
onOpenToggle={this.props.onOpenToggle}
title="Maputnik Survey"