mirror of
https://github.com/maputnik/editor.git
synced 2026-07-25 23:37:27 +00:00
Add a test to make sure this functionality doesn't get broken
This commit is contained in:
@@ -77,11 +77,18 @@ describe("modals", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("name", () => {
|
it("name", () => {
|
||||||
|
when.click("field-doc-button-Name");
|
||||||
|
|
||||||
|
should.containText("spec-field-doc", "name for the style");
|
||||||
|
});
|
||||||
|
|
||||||
|
it("show name specifications", () => {
|
||||||
when.setValue(get.dataAttribute("modal:settings.name"), "foobar");
|
when.setValue(get.dataAttribute("modal:settings.name"), "foobar");
|
||||||
when.click("modal:settings.owner");
|
when.click("modal:settings.owner");
|
||||||
|
|
||||||
should.equalStyleStore((obj) => obj.name, "foobar");
|
should.equalStyleStore((obj) => obj.name, "foobar");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("owner", () => {
|
it("owner", () => {
|
||||||
when.setValue(get.dataAttribute("modal:settings.owner"), "foobar");
|
when.setValue(get.dataAttribute("modal:settings.owner"), "foobar");
|
||||||
when.click("modal:settings.name");
|
when.click("modal:settings.name");
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ export default class Doc extends React.Component<DocProps> {
|
|||||||
<>
|
<>
|
||||||
{doc &&
|
{doc &&
|
||||||
<div className="SpecDoc">
|
<div className="SpecDoc">
|
||||||
<div className="SpecDoc__doc">{doc}</div>
|
<div className="SpecDoc__doc" data-wd-key='spec-field-doc'>{doc}</div>
|
||||||
{renderValues &&
|
{renderValues &&
|
||||||
<ul className="SpecDoc__values">
|
<ul className="SpecDoc__values">
|
||||||
{Object.entries(values).map(([key, value]) => {
|
{Object.entries(values).map(([key, value]) => {
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ export default class FieldDocLabel extends React.Component<FieldDocLabelProps, F
|
|||||||
aria-label={this.state.open ? "close property documentation" : "open property documentation"}
|
aria-label={this.state.open ? "close property documentation" : "open property documentation"}
|
||||||
className={`maputnik-doc-button maputnik-doc-button--${this.state.open ? 'open' : 'closed'}`}
|
className={`maputnik-doc-button maputnik-doc-button--${this.state.open ? 'open' : 'closed'}`}
|
||||||
onClick={() => this.onToggleDoc(!this.state.open)}
|
onClick={() => this.onToggleDoc(!this.state.open)}
|
||||||
|
data-wd-key={'field-doc-button-'+label}
|
||||||
>
|
>
|
||||||
{this.state.open ? <MdHighlightOff /> : <MdInfoOutline />}
|
{this.state.open ? <MdHighlightOff /> : <MdInfoOutline />}
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
Reference in New Issue
Block a user