Skip to content

Commit

Permalink
fix: code hidden issue for JS Enabled fields (#13241)
Browse files Browse the repository at this point in the history
* fix code hidden issue for JS Enabled fields

* test for code hidden fix
  • Loading branch information
ganganimaulik committed Apr 27, 2022
1 parent 7b09976 commit 0eef3b0
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
const dsl = require("../../../../fixtures/jsonFormDslWithSchema.json");
const { ObjectsRegistry } = require("../../../../support/Objects/Registry");
let ee = ObjectsRegistry.EntityExplorer;

describe("Property pane js enabled field", function() {
before(() => {
cy.addDsl(dsl);
});

it("Ensure text is visible for js enabled field when a section is collapsed by default", function() {
cy.openPropertyPane("jsonformwidget");

cy.get(".t--property-pane-section-collapse-submitbuttonstyles").click();
cy.get(".t--property-control-buttonvariant")
.find(".t--js-toggle")
.first()
.click();

cy.get(".t--property-control-buttonvariant")
.find(".t--js-toggle")
.first()
.should("have.class", "is-active");

cy.get(".t--property-control-buttonvariant .CodeMirror-code").type(
"PRIMARY",
);
cy.get(".t--property-control-buttonvariant")
.find(".CodeMirror-code")
.invoke("text")
.should("equal", "PRIMARY");

cy.closePropertyPane();
cy.wait(1000);

cy.openPropertyPane("jsonformwidget");
cy.get(".t--property-pane-section-collapse-submitbuttonstyles").click();
cy.get(".t--property-control-buttonvariant")
.find(".CodeMirror-code")
.invoke("text")
.should("equal", "PRIMARY");
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ class CodeEditor extends Component<Props, State> {
componentDidMount(): void {
if (this.codeEditorTarget.current) {
const options: EditorConfiguration = {
autoRefresh: true,
mode: this.props.mode,
theme: EditorThemes[this.props.theme],
viewportMargin: 10,
Expand Down

0 comments on commit 0eef3b0

Please sign in to comment.