diff --git a/src/core/components/primitive-model.jsx b/src/core/components/primitive-model.jsx index 4874513a..7135cc6a 100644 --- a/src/core/components/primitive-model.jsx +++ b/src/core/components/primitive-model.jsx @@ -50,7 +50,7 @@ export default class Primitive extends Component { return - = expandDepth} collapsedContent=" " hideSelfOnExpand={expandDepth !== depth}> + {name && depth > 1 && {title}} {type} diff --git a/test/e2e-cypress/tests/features/model-collapse.js b/test/e2e-cypress/tests/features/model-collapse.js index bc027257..0c6d688b 100644 --- a/test/e2e-cypress/tests/features/model-collapse.js +++ b/test/e2e-cypress/tests/features/model-collapse.js @@ -42,6 +42,7 @@ function ModelCollapseTest(baseUrl, urlFragment) { .get("#model-User .model-box .model .inner-object") .should("exist") .get("#model-User .model-box .model-box-control") + .first() .click() .get("#model-User .model-box .model .inner-object") .should("not.exist") diff --git a/test/e2e-cypress/tests/features/spec-parse-to-json.js b/test/e2e-cypress/tests/features/spec-parse-to-json.js index 14af3dad..db23e4d0 100644 --- a/test/e2e-cypress/tests/features/spec-parse-to-json.js +++ b/test/e2e-cypress/tests/features/spec-parse-to-json.js @@ -15,9 +15,17 @@ describe("Parse YAML as YAML@1.2 with json_schema for all JSON-supported types", // Responses -> schema tab .get(".model-example > .tab > :nth-child(2)") .click() - .get(":nth-child(1) > :nth-child(2) > .model > :nth-child(1) > .prop > .property") // first element, without-quotes + .get(":nth-child(1) > :nth-child(2) > .model > :nth-child(1)") + .click() + .get( + ":nth-child(1) > :nth-child(2) > .model > :nth-child(1) > .prop > .property" + ) // first element, without-quotes .should("have.text", "example: 1999-11-31") - .get(":nth-child(2) > :nth-child(2) > .model > :nth-child(1) > .prop > .property") // second element, with quotes + .get(":nth-child(2) > :nth-child(2) > .model > :nth-child(1)") + .click() + .get( + ":nth-child(2) > :nth-child(2) > .model > :nth-child(1) > .prop > .property" + ) // second element, with quotes .should("have.text", "example: 1999-12-31") }) })