ManageIQ/manageiq-ui-classic

View on GitHub
app/javascript/spec/miq-structured-list/__snapshots__/miq-structured-list.spec.js.snap

Summary

Maintainability
Test Coverage
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Structured list component should render a miq_policy_set show page without double escaping strings 1`] = `
<Accordion
  align="start"
  className="miq-structured-list-accordion miq_policy_set"
>
  <AccordionItem
    open={true}
    title="Policies"
  >
    <FeatureToggle(StructuredListWrapper)
      ariaLabel="Structured list"
      className="miq-structured-list miq_policy_set"
    >
      <MiqStructuredListBody
        clickEvents={false}
        mode="miq_policy_set"
        onClick={[MockFunction]}
        rows={
          Array [
            Object {
              "label": "Description",
              "value": "& Application SLA &",
            },
            Object {
              "icon": "pficon pficon-image",
              "onclick": Object {
                "url": "/miq_policy/show/1",
              },
              "title": "View this Policy",
              "value": "description one &&",
            },
            Object {
              "icon": "pficon pficon-container-node",
              "onclick": Object {
                "url": "/miq_policy/show/2",
              },
              "title": "View this Policy",
              "value": "description two &&",
            },
            Object {
              "icon": "pficon pficon-virtual-machine",
              "onclick": Object {
                "url": "/miq_policy/show/3",
              },
              "title": "View this Policy",
              "value": "description three &&",
            },
          ]
        }
      />
    </FeatureToggle(StructuredListWrapper)>
  </AccordionItem>
</Accordion>
`;

exports[`Structured list component should render a multilink_list table 1`] = `
<Accordion
  align="start"
  className="miq-structured-list-accordion multilink_table"
>
  <AccordionItem
    open={true}
    title="Some OpenStack Stuff"
  >
    <FeatureToggle(StructuredListWrapper)
      ariaLabel="Structured list"
      className="miq-structured-list multilink_table"
    >
      <MiqStructuredListBody
        clickEvents={false}
        mode="multilink_table"
        onClick={[MockFunction]}
        rows={
          Array [
            Object {
              "sub_items": Array [
                Object {
                  "icon": "pficon pficon-ok",
                  "link": "/host/host_services/18?db=host&host_service_group=1&status=running",
                  "title": "Show list of running Aodh",
                  "value": "Running (3)",
                },
                Object {
                  "icon": null,
                  "link": null,
                  "title": "Show list of failed Aodh",
                  "value": "Failed (0)",
                },
                Object {
                  "icon": "pficon pficon-service",
                  "link": "/host/host_services/18?db=host&host_service_group=1&status=all",
                  "title": "Show list of all Aodh",
                  "value": "All (3)",
                },
                Object {
                  "icon": "fa fa-file-o",
                  "link": null,
                  "title": "Show list of configuration files of Aodh",
                  "value": "Configuration (0)",
                },
              ],
              "value": "Aodh",
            },
            Object {
              "sub_items": Array [
                Object {
                  "icon": "pficon pficon-ok",
                  "link": "/host/host_services/18?db=host&host_service_group=2&status=running",
                  "title": "Show list of running Ceilometer",
                  "value": "Running (3)",
                },
                Object {
                  "icon": null,
                  "link": null,
                  "title": "Show list of failed Ceilometer",
                  "value": "Failed (0)",
                },
                Object {
                  "icon": "pficon pficon-service",
                  "link": "/host/host_services/18?db=host&host_service_group=2&status=all",
                  "title": "Show list of all Ceilometer",
                  "value": "All (3)",
                },
                Object {
                  "icon": "fa fa-file-o",
                  "link": null,
                  "title": "Show list of configuration files of Ceilometer",
                  "value": "Configuration (0)",
                },
              ],
              "value": "Ceilometer",
            },
            Object {
              "sub_items": Array [
                Object {
                  "icon": "pficon pficon-ok",
                  "link": "/host/host_services/18?db=host&host_service_group=3&status=running",
                  "title": "Show list of running Cinder",
                  "value": "Running (3)",
                },
                Object {
                  "icon": null,
                  "link": null,
                  "title": "Show list of failed Cinder",
                  "value": "Failed (0)",
                },
                Object {
                  "icon": "pficon pficon-service",
                  "link": "/host/host_services/18?db=host&host_service_group=3&status=all",
                  "title": "Show list of all Cinder",
                  "value": "All (3)",
                },
                Object {
                  "icon": "fa fa-file-o",
                  "link": null,
                  "title": "Show list of configuration files of Cinder",
                  "value": "Configuration (0)",
                },
              ],
              "value": "Cinder",
            },
            Object {
              "sub_items": Array [
                Object {
                  "icon": "pficon pficon-ok",
                  "link": "/host/host_services/18?db=host&host_service_group=4&status=running",
                  "title": "Show list of running Glance",
                  "value": "Running (2)",
                },
                Object {
                  "icon": null,
                  "link": null,
                  "title": "Show list of failed Glance",
                  "value": "Failed (0)",
                },
                Object {
                  "icon": "pficon pficon-service",
                  "link": "/host/host_services/18?db=host&host_service_group=4&status=all",
                  "title": "Show list of all Glance",
                  "value": "All (2)",
                },
                Object {
                  "icon": "fa fa-file-o",
                  "link": null,
                  "title": "Show list of configuration files of Glance",
                  "value": "Configuration (0)",
                },
              ],
              "value": "Glance",
            },
            Object {
              "sub_items": Array [
                Object {
                  "icon": "pficon pficon-ok",
                  "link": "/host/host_services/18?db=host&host_service_group=5&status=running",
                  "title": "Show list of running Gnocchi",
                  "value": "Running (2)",
                },
                Object {
                  "icon": null,
                  "link": null,
                  "title": "Show list of failed Gnocchi",
                  "value": "Failed (0)",
                },
                Object {
                  "icon": "pficon pficon-service",
                  "link": "/host/host_services/18?db=host&host_service_group=5&status=all",
                  "title": "Show list of all Gnocchi",
                  "value": "All (2)",
                },
                Object {
                  "icon": "fa fa-file-o",
                  "link": null,
                  "title": "Show list of configuration files of Gnocchi",
                  "value": "Configuration (0)",
                },
              ],
              "value": "Gnocchi",
            },
            Object {
              "sub_items": Array [
                Object {
                  "icon": "pficon pficon-ok",
                  "link": "/host/host_services/18?db=host&host_service_group=6&status=running",
                  "title": "Show list of running Heat",
                  "value": "Running (4)",
                },
                Object {
                  "icon": null,
                  "link": null,
                  "title": "Show list of failed Heat",
                  "value": "Failed (0)",
                },
                Object {
                  "icon": "pficon pficon-service",
                  "link": "/host/host_services/18?db=host&host_service_group=6&status=all",
                  "title": "Show list of all Heat",
                  "value": "All (4)",
                },
                Object {
                  "icon": "fa fa-file-o",
                  "link": null,
                  "title": "Show list of configuration files of Heat",
                  "value": "Configuration (0)",
                },
              ],
              "value": "Heat",
            },
            Object {
              "sub_items": Array [
                Object {
                  "icon": null,
                  "link": null,
                  "title": "Show list of running Keystone",
                  "value": "Running (0)",
                },
                Object {
                  "icon": null,
                  "link": null,
                  "title": "Show list of failed Keystone",
                  "value": "Failed (0)",
                },
                Object {
                  "icon": "pficon pficon-service",
                  "link": "/host/host_services/18?db=host&host_service_group=7&status=all",
                  "title": "Show list of all Keystone",
                  "value": "All (1)",
                },
                Object {
                  "icon": "fa fa-file-o",
                  "link": null,
                  "title": "Show list of configuration files of Keystone",
                  "value": "Configuration (0)",
                },
              ],
              "value": "Keystone",
            },
            Object {
              "sub_items": Array [
                Object {
                  "icon": "pficon pficon-ok",
                  "link": "/host/host_services/18?db=host&host_service_group=8&status=running",
                  "title": "Show list of running Nova",
                  "value": "Running (5)",
                },
                Object {
                  "icon": null,
                  "link": null,
                  "title": "Show list of failed Nova",
                  "value": "Failed (0)",
                },
                Object {
                  "icon": "pficon pficon-service",
                  "link": "/host/host_services/18?db=host&host_service_group=8&status=all",
                  "title": "Show list of all Nova",
                  "value": "All (10)",
                },
                Object {
                  "icon": "fa fa-file-o",
                  "link": null,
                  "title": "Show list of configuration files of Nova",
                  "value": "Configuration (0)",
                },
              ],
              "value": "Nova",
            },
            Object {
              "sub_items": Array [
                Object {
                  "icon": "pficon pficon-ok",
                  "link": "/host/host_services/18?db=host&host_service_group=9&status=running",
                  "title": "Show list of running Swift",
                  "value": "Running (14)",
                },
                Object {
                  "icon": null,
                  "link": null,
                  "title": "Show list of failed Swift",
                  "value": "Failed (0)",
                },
                Object {
                  "icon": "pficon pficon-service",
                  "link": "/host/host_services/18?db=host&host_service_group=9&status=all",
                  "title": "Show list of all Swift",
                  "value": "All (14)",
                },
                Object {
                  "icon": "fa fa-file-o",
                  "link": null,
                  "title": "Show list of configuration files of Swift",
                  "value": "Configuration (0)",
                },
              ],
              "value": "Swift",
            },
          ]
        }
      />
    </FeatureToggle(StructuredListWrapper)>
  </AccordionItem>
</Accordion>
`;

exports[`Structured list component should render a operation_range table 1`] = `
<Accordion
  align="start"
  className="miq-structured-list-accordion operation_ranges"
>
  <AccordionItem
    open={true}
    title="Operation Ranges"
  >
    <FeatureToggle(StructuredListWrapper)
      ariaLabel="Structured list"
      className="miq-structured-list operation_ranges"
    >
      <MiqStructuredListBody
        clickEvents={false}
        mode="operation_ranges"
        onClick={[MockFunction]}
        rows={
          Array [
            Object {
              "hoverClass": "no-hover",
              "label": "CPU",
              "value": Array [
                Object {
                  "label": "Max",
                  "value": "Not Available",
                },
                Object {
                  "label": "High",
                  "value": "0 MHz",
                },
                Object {
                  "label": "Average",
                  "value": "0 MHz",
                },
                Object {
                  "label": "Low",
                  "value": "0 MHz",
                },
              ],
            },
            Object {
              "hoverClass": "no-hover",
              "label": "CPU Usage",
              "value": Array [
                Object {
                  "label": "Max",
                  "value": "Not Available",
                },
                Object {
                  "label": "High",
                  "value": "0.00%",
                },
                Object {
                  "label": "Average",
                  "value": "0.00%",
                },
                Object {
                  "label": "Low",
                  "value": "0.00%",
                },
              ],
            },
          ]
        }
      />
    </FeatureToggle(StructuredListWrapper)>
  </AccordionItem>
</Accordion>
`;

exports[`Structured list component should render a report_information page without double escaping strings 1`] = `
<Accordion
  align="start"
  className="miq-structured-list-accordion miq_report_schedules"
>
  <AccordionItem
    open={true}
    title="report_information"
  >
    <FeatureToggle(StructuredListWrapper)
      ariaLabel="Structured list"
      className="miq-structured-list miq_report_schedules"
    >
      <MiqStructuredListBody
        clickEvents={false}
        mode="miq_report_schedules"
        onClick={[MockFunction]}
        rows={
          Array [
            Object {
              "label": "Last Run Time",
              "value": "& 2022-12-07 02:00:00 UTC &",
            },
            Object {
              "label": "Next Run Time",
              "value": "& 2022-12-07 02:00:00 UTC &&",
            },
          ]
        }
      />
    </FeatureToggle(StructuredListWrapper)>
  </AccordionItem>
</Accordion>
`;

exports[`Structured list component should render a simple_table 1`] = `
<Accordion
  align="start"
  className="miq-structured-list-accordion simple_table"
>
  <AccordionItem
    open={true}
    title="Firewall Rules"
  >
    <MiqStructuredListMessage
      title="Firewall Rules"
    />
  </AccordionItem>
</Accordion>
`;

exports[`Structured list component should render a simple_table with generic data 1`] = `
<Accordion
  align="start"
  className="miq-structured-list-accordion simple_table"
>
  <AccordionItem
    open={true}
    title="Foo Bar"
  >
    <FeatureToggle(StructuredListWrapper)
      ariaLabel="Structured list"
      className="miq-structured-list simple_table"
    >
      <MiqStructuredListBody
        clickEvents={false}
        mode="simple_table"
        onClick={[MockFunction]}
        rows={
          Array [
            Object {
              "hoverClass": "bar",
              "label": "foo",
              "value": "bar",
            },
            Object {
              "hoverClass": "bar",
              "label": "mrkef?",
              "value": "v zime!",
            },
          ]
        }
      />
    </FeatureToggle(StructuredListWrapper)>
  </AccordionItem>
</Accordion>
`;

exports[`Structured list component should render a simple_table with sortable and expandable data 1`] = `
<Accordion
  align="start"
  className="miq-structured-list-accordion simple_table"
>
  <AccordionItem
    open={true}
    title="Build Instances"
  >
    <FeatureToggle(StructuredListWrapper)
      ariaLabel="Structured list"
      className="miq-structured-list simple_table"
    >
      <MiqStructuredListHeader
        headers={
          Array [
            "Name",
            "Phase",
            "Message",
            "Reason",
            "Pod",
            "Output Image",
            "Start Timestamp",
            Object {
              "sortable": "desc",
              "value": "Completion Timestamp",
            },
            "Duration",
          ]
        }
      />
      <MiqStructuredListBody
        clickEvents={false}
        mode="simple_table"
        onClick={[MockFunction]}
        rows={
          Array [
            Array [
              "cart-1",
              "Complete",
              Object {
                "expandable": true,
                "value": null,
              },
              null,
              "No Pod",
              Object {
                "expandable": true,
                "value": "docker-registry.default.svc:5000/coolstore/cart:latest",
              },
              "2018-01-13T23:53:59Z",
              "2018-01-13T23:57:57Z",
              "3m58s",
            ],
          ]
        }
      />
    </FeatureToggle(StructuredListWrapper)>
  </AccordionItem>
</Accordion>
`;

exports[`Structured list component should render a table_list_view table 1`] = `
<Accordion
  align="start"
  className="miq-structured-list-accordion table_list_view"
>
  <AccordionItem
    open={true}
    title="Tables with the Most Rows"
  >
    <MiqStructuredListMessage
      title="Tables with the Most Rows"
    />
  </AccordionItem>
</Accordion>
`;

exports[`Structured list component should render a tag_group table 1`] = `
<Accordion
  align="start"
  className="miq-structured-list-accordion tag_group"
>
  <AccordionItem
    open={true}
    title="Smart Management"
  >
    <FeatureToggle(StructuredListWrapper)
      ariaLabel="Structured list"
      className="miq-structured-list tag_group"
    >
      <MiqStructuredListBody
        clickEvents={false}
        mode="tag_group"
        onClick={[MockFunction]}
        rows={
          Array [
            Object {
              "hoverClass": "no-hover",
              "icon": "pficon pficon-zone",
              "label": "Managed by Zone",
              "value": "default",
            },
            Object {
              "hoverClass": "no-hover",
              "label": "My Company X Tags",
              "value": Array [
                Object {
                  "icon": "fa fa-tag",
                  "label": "Dan Test",
                  "value": Array [
                    "Test 1",
                  ],
                },
                Object {
                  "icon": "fa fa-tag",
                  "label": "Demo bla",
                  "value": Array [
                    "Policy",
                    "2",
                  ],
                },
              ],
            },
            Object {
              "label": "Other Tags",
              "title": "All Other Tags",
              "value": Array [
                Object {
                  "icon": "fa fa-tag",
                  "label": "Test",
                  "value": Array [
                    "Test 1",
                  ],
                },
                Object {
                  "icon": "fa fa-tag",
                  "label": "Demo 2",
                  "value": Array [
                    "Policy",
                    "2",
                    "3",
                  ],
                },
                Object {
                  "link": "You clicked on Demo 3",
                  "title": "Click to display the item",
                  "value": Array [
                    "Demo 3",
                  ],
                },
              ],
            },
          ]
        }
      />
    </FeatureToggle(StructuredListWrapper)>
  </AccordionItem>
</Accordion>
`;

exports[`Structured list component should render catalog_data with escaped strings 1`] = `
<Accordion
  align="start"
  className="miq-structured-list-accordion catalog_list_view"
>
  <AccordionItem
    open={true}
    title="Basic Information"
  >
    <FeatureToggle(StructuredListWrapper)
      ariaLabel="Structured list"
      className="miq-structured-list catalog_list_view"
    >
      <MiqStructuredListBody
        clickEvents={false}
        mode="catalog_list_view"
        onClick={[MockFunction]}
        rows={
          Array [
            Object {
              "label": "Name / Description",
              "value": "GCE Catalog item / Test &",
            },
            Object {
              "label": "Catalog",
              "value": "My Own && Catalog",
            },
            Object {
              "label": "Zone",
              "value": "Google",
            },
          ]
        }
      />
    </FeatureToggle(StructuredListWrapper)>
  </AccordionItem>
</Accordion>
`;

exports[`Structured list component should render code mirror component 1`] = `
<Accordion
  align="start"
  className="miq-structured-list-accordion miq_summary code_mirror"
>
  <AccordionItem
    open={true}
    title="Automation Method Data"
  >
    <FeatureToggle(StructuredListWrapper)
      ariaLabel="Structured list"
      className="miq-structured-list miq_summary code_mirror"
    >
      <MiqStructuredListBody
        clickEvents={true}
        mode="miq_summary code_mirror"
        onClick={[MockFunction]}
        rows={
          Array [
            Object {
              "label": "Label",
              "value": "Value",
            },
            Object {
              "label": "",
              "title": "code mirror",
              "value": Object {
                "input": "code_mirror",
                "props": Object {
                  "mode": "ruby",
                  "payload": "
  def notify(level, message, subject)
    $evm.create_notification(:audience => 'user', :level => level, :message => message)
  end",
                },
              },
            },
          ]
        }
      />
    </FeatureToggle(StructuredListWrapper)>
  </AccordionItem>
</Accordion>
`;

exports[`Structured list component should render miq policy data without double escaping strings 1`] = `
<FeatureToggle(StructuredListWrapper)
  ariaLabel="Structured list"
  className="miq-structured-list miq_policy_details"
>
  <MiqStructuredListBody
    clickEvents={false}
    mode="miq_policy_details"
    rows={
      Array [
        Object {
          "label": "Active",
          "value": "Yes &",
        },
        Object {
          "label": "Created",
          "value": "By Username Thor Odinson && at 2020-10-10 15T $UTC",
        },
        Object {
          "label": "Last Updated",
          "value": "By Username Lord Loki && at 2020-10-10 15T $UTC &",
        },
        Object {
          "icon": "pficon pficon-close",
          "onclick": Object {
            "url": "/miq_action/show/1",
          },
          "title": "View this Action",
          "value": "Test &&",
        },
      ]
    }
  />
</FeatureToggle(StructuredListWrapper)>
`;

exports[`Structured list component should render miq_ae_class_list_view with escaped strings 1`] = `
<Accordion
  align="start"
  className="miq-structured-list-accordion table_list_view"
>
  <AccordionItem
    open={true}
    title="Properties"
  >
    <FeatureToggle(StructuredListWrapper)
      ariaLabel="Structured list"
      className="miq-structured-list table_list_view"
    >
      <MiqStructuredListBody
        clickEvents={false}
        mode="table_list_view"
        onClick={[MockFunction]}
        rows={
          Array [
            Object {
              "label": "Fully Qualified Name",
              "value": "ManageIQ / Automation Management / Test &",
            },
            Object {
              "label": "Name",
              "value": "Thor Odinson",
            },
            Object {
              "label": "Instances",
              "value": "1 &",
            },
          ]
        }
      />
    </FeatureToggle(StructuredListWrapper)>
  </AccordionItem>
</Accordion>
`;

exports[`Structured list component should render miq_alert_show page without double escaping strings 1`] = `
<Accordion
  align="start"
  className="miq-structured-list-accordion miq_alert_id"
>
  <AccordionItem
    open={true}
    title="Belongs to Alert profiles"
  >
    <FeatureToggle(StructuredListWrapper)
      ariaLabel="Structured list"
      className="miq-structured-list miq_alert_id"
    >
      <MiqStructuredListBody
        clickEvents={false}
        mode="miq_alert_id"
        onClick={[MockFunction]}
        rows={
          Array [
            Object {
              "icon": "pficon pficon-warning-triangle-o",
              "onclick": Object {
                "url": "/miq_alert_set/show/1",
              },
              "title": "View this Alert Profile",
              "value": "view this &&",
            },
          ]
        }
      />
    </FeatureToggle(StructuredListWrapper)>
  </AccordionItem>
</Accordion>
`;

exports[`Structured list component should render miq_reports_data without double escaping strings 1`] = `
<Accordion
  align="start"
  className="miq-structured-list-accordion miq_policy_set"
>
  <AccordionItem
    open={true}
    title="Policies"
  >
    <FeatureToggle(StructuredListWrapper)
      ariaLabel="Structured list"
      className="miq-structured-list miq_policy_set"
    >
      <MiqStructuredListBody
        clickEvents={false}
        mode="miq_policy_set"
        onClick={[MockFunction]}
        rows={
          Array [
            Object {
              "label": "Description",
              "value": "& Application SLA &",
            },
            Object {
              "icon": "pficon pficon-image",
              "onclick": Object {
                "url": "/miq_policy/show/1",
              },
              "title": "View this Policy",
              "value": "description one &&",
            },
            Object {
              "icon": "pficon pficon-container-node",
              "onclick": Object {
                "url": "/miq_policy/show/2",
              },
              "title": "View this Policy",
              "value": "description two &&",
            },
            Object {
              "icon": "pficon pficon-virtual-machine",
              "onclick": Object {
                "url": "/miq_policy/show/3",
              },
              "title": "View this Policy",
              "value": "description three &&",
            },
          ]
        }
      />
    </FeatureToggle(StructuredListWrapper)>
  </AccordionItem>
</Accordion>
`;

exports[`Structured list component should render report_schedule page without double escaping strings 1`] = `
<Accordion
  align="start"
  className="miq-structured-list-accordion miq_report_schedule_info"
>
  <AccordionItem
    open={true}
    title="Schedule Info"
  >
    <FeatureToggle(StructuredListWrapper)
      ariaLabel="Structured list"
      className="miq-structured-list miq_report_schedule_info"
    >
      <MiqStructuredListBody
        clickEvents={false}
        mode="miq_report_schedule_info"
        onClick={[MockFunction]}
        rows={
          Array [
            Object {
              "label": "Description",
              "value": "My_Host Network Information &&",
            },
            Object {
              "label": "Active",
              "value": "True &&",
            },
            Object {
              "label": "E-Mail after Running",
              "value": "True &&",
            },
            Object {
              "label": "From E-mail",
              "value": "(Default: test@test.com) &&",
            },
            Object {
              "label": "Run At",
              "value": "&& Run once on Thu Nov 15 01:10:00 UTC 2018 &&",
            },
          ]
        }
      />
    </FeatureToggle(StructuredListWrapper)>
  </AccordionItem>
</Accordion>
`;

exports[`Structured list component should render settings list 1`] = `
<FeatureToggle(StructuredListWrapper)
  ariaLabel="Structured list"
  className="miq-structured-list selected_server_roles"
>
  <MiqStructuredListBody
    clickEvents={false}
    mode="selected_server_roles"
    rows={
      Array [
        Object {
          "icon": "pficon pficon-server fa-5x",
        },
        Object {
          "label": "Server",
          "value": "EVM(17)",
        },
        Object {
          "label": "IP Address",
          "value": "127.1.1.0",
        },
        Object {
          "label": "Status",
          "value": "Active",
        },
      ]
    }
  />
</FeatureToggle(StructuredListWrapper)>
`;

exports[`Structured list component should render strings without double escaping strings 1`] = `
<FeatureToggle(StructuredListWrapper)
  ariaLabel="Structured list"
  className="miq-structured-list miq_summary miq_host_devices"
>
  <MiqStructuredListBody
    clickEvents={true}
    mode="miq_summary miq_host_devices"
    onClick={[MockFunction]}
    rows={
      Array [
        Object {
          "cells": Object {
            "icon": "pficon pficon-unknown",
            "label": "Catch All",
            "value": "< A test to HTML's \\"Escape\\" logic Hello&Goodbye >",
          },
        },
      ]
    }
  />
</FeatureToggle(StructuredListWrapper)>
`;