theforeman/foreman

View on GitHub
webpack/assets/javascripts/react_app/components/SettingRecords/__tests__/__snapshots__/SettingRecordsSelectors.test.js.snap

Summary

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

exports[`SettingRecordsSelectors should select setting by id 1`] = `
Object {
  "category": "Setting::Email",
  "configFile": "settings.yaml",
  "createdAt": "2019-11-06 09:42:45 +0100",
  "default": "root@example.com",
  "description": "Email reply address for emails that Foreman is sending",
  "encrypted": false,
  "fullName": "Email reply address",
  "id": 36,
  "name": "email_reply_address",
  "readonly": false,
  "selectValues": null,
  "settingsType": "string",
  "updatedAt": "2020-04-29 15:48:23 +0200",
  "value": "root@example.com",
}
`;

exports[`SettingRecordsSelectors should select setting records 1`] = `
Object {
  "General": Array [
    Object {
      "category": "General",
      "configFile": "settings.yaml",
      "createdAt": "2019-11-06 09:42:45 +0100",
      "default": "root@example.com",
      "description": "The default administrator email address",
      "encrypted": false,
      "fullName": "Administrator email address",
      "id": 36,
      "name": "administrator",
      "readonly": false,
      "selectValues": null,
      "settingsType": "string",
      "updatedAt": "2020-04-29 15:48:23 +0200",
      "value": "root@example.com",
    },
    Object {
      "category": "General",
      "configFile": "settings.yaml",
      "createdAt": "2018-01-22 14:03:38 +0100",
      "default": false,
      "description": "Foreman will append domain names when new hosts are provisioned",
      "encrypted": false,
      "fullName": "Append domain names to the host",
      "id": 177,
      "name": "display_fqdn_for_hosts",
      "readonly": false,
      "selectValues": null,
      "settingsType": "boolean",
      "updatedAt": "2018-01-22 14:03:38 +0100",
      "value": true,
    },
    Object {
      "category": "General",
      "configFile": "settings.yaml",
      "default": null,
      "description": "Timezone to use for new users",
      "encrypted": false,
      "fullName": "Default timezone",
      "id": 27,
      "name": "default_timezone",
      "readonly": false,
      "selectValues": Object {
        "": "Browser timezone",
        "Abu Dhabi": "(GMT +04:00) Abu Dhabi",
        "Adelaide": "(GMT +09:30) Adelaide",
        "Alaska": "(GMT -09:00) Alaska",
        "Almaty": "(GMT +06:00) Almaty",
        "American Samoa": "(GMT -11:00) American Samoa",
        "Amsterdam": "(GMT +01:00) Amsterdam",
        "Arizona": "(GMT -07:00) Arizona",
        "Astana": "(GMT +06:00) Astana",
        "Athens": "(GMT +02:00) Athens",
        "Atlantic Time (Canada)": "(GMT -04:00) Atlantic Time (Canada)",
        "Auckland": "(GMT +12:00) Auckland",
        "Azores": "(GMT -01:00) Azores",
        "Baghdad": "(GMT +03:00) Baghdad",
        "Baku": "(GMT +04:00) Baku",
        "Bangkok": "(GMT +07:00) Bangkok",
      },
      "settingsType": null,
      "value": "Bangkok",
    },
    Object {
      "category": "General",
      "configFile": "settings.yaml",
      "createdAt": "2019-11-06 09:42:45 +0100",
      "default": Array [],
      "description": "Set hostnames to which requests are not to be proxied. Requests to the local host are excluded by default.",
      "encrypted": false,
      "fullName": "HTTP(S) proxy except hosts",
      "id": 47,
      "name": "http_proxy_except_list",
      "readonly": false,
      "selectValues": null,
      "settingsType": "array",
      "updatedAt": "2020-03-20 13:44:40 +0100",
      "value": Array [
        "localhost",
        "127.0.0.1",
      ],
    },
  ],
  "Setting::Auth": Array [
    Object {
      "category": "Setting::Auth",
      "configFile": "settings.yaml",
      "createdAt": "2019-04-30 11:24:17 +0200",
      "default": 4,
      "description": "Cost value of bcrypt password hash function for internal auth-sources (4-30). Higher value is safer but verification is slower particularly for stateless API calls and UI logins. Password change needed to take effect.",
      "encrypted": false,
      "fullName": "BCrypt password cost",
      "id": 232,
      "name": "bcrypt_cost",
      "readonly": false,
      "selectValues": null,
      "settingsType": "integer",
      "updatedAt": "2019-10-09 10:02:35 +0200",
      "value": 9,
    },
  ],
  "Setting::Email": Array [
    Object {
      "category": "Setting::Email",
      "configFile": "settings.yaml",
      "createdAt": "2019-11-06 09:42:45 +0100",
      "default": "root@example.com",
      "description": "Email reply address for emails that Foreman is sending",
      "encrypted": false,
      "fullName": "Email reply address",
      "id": 36,
      "name": "email_reply_address",
      "readonly": false,
      "selectValues": null,
      "settingsType": "string",
      "updatedAt": "2020-04-29 15:48:23 +0200",
      "value": "root@example.com",
    },
  ],
  "Setting::Provisioning": Array [
    Object {
      "category": "Setting::Provisioning",
      "configFile": "settings.yaml",
      "createdAt": "2019-11-06 09:42:45 +0100",
      "default": "foobar",
      "description": "Default encrypted root password on provisioned hosts",
      "encrypted": true,
      "fullName": "Root password",
      "id": 73,
      "name": "root_pass",
      "readonly": false,
      "selectValues": null,
      "settingsType": "string",
      "updatedAt": "2020-04-29 15:48:23 +0200",
      "value": "*****",
    },
    Object {
      "category": "Setting::Provisioning",
      "configFile": "settings.yaml",
      "createdAt": "2018-11-06 09:42:45 +0100",
      "default": "PXELinux global default",
      "description": "Global default PXELinux template. This template gets deployed to all configured TFTP servers. It will not be affected by upgrades.",
      "encrypted": false,
      "fullName": "Global default PXELinux template",
      "id": 105,
      "name": "global_PXELinux",
      "readonly": false,
      "selectValues": Object {
        "CoreOS PXELinux": "CoreOS PXELinux",
        "FreeBSD (mfsBSD) PXELinux": "FreeBSD (mfsBSD) PXELinux",
        "Kickstart default PXELinux": "Kickstart default PXELinux",
        "Kickstart oVirt-RHVH PXELinux": "Kickstart oVirt-RHVH PXELinux",
        "PXELinux chain iPXE": "PXELinux chain iPXE",
        "PXELinux chain iPXE UNDI": "PXELinux chain iPXE UNDI",
        "PXELinux default local boot": "PXELinux default local boot",
        "PXELinux default memdisk": "PXELinux default memdisk",
        "PXELinux global default": "PXELinux global default",
        "Preseed default PXELinux": "Preseed default PXELinux",
        "RancherOS PXELinux": "RancherOS PXELinux",
        "TEST default": "TEST default",
        "WAIK default PXELinux": "WAIK default PXELinux",
        "Windows default PXELinux": "Windows default PXELinux",
        "XenServer default PXELinux": "XenServer default PXELinux",
        "[templates] A fake pxelinux": "[templates] A fake pxelinux",
      },
    },
    Object {
      "category": "Setting::Provisioning",
      "configFile": "settings.yaml",
      "createdAt": "2019-11-06 09:42:45 +0100",
      "default": "4-Users",
      "description": "Default owner on provisioned hosts, if empty Foreman will use current user",
      "encrypted": false,
      "fullName": "Host owner",
      "id": 85,
      "name": "host_owner",
      "readonly": false,
      "selectValues": Array [
        Object {
          "label": "Select an owner",
          "value": null,
        },
        Object {
          "children": Array [
            Object {
              "label": "canned_admin",
              "value": "13-Users",
            },
            Object {
              "label": "user",
              "value": "19-Users",
            },
            Object {
              "label": "viewer",
              "value": "27-Users",
            },
            Object {
              "label": "admin",
              "value": "4-Users",
            },
          ],
          "group_label": "Users",
        },
        Object {
          "children": Array [
            Object {
              "label": "basic broup",
              "value": "1-Usergroups",
            },
            Object {
              "label": "view hosts group",
              "value": "2-Usergroups",
            },
          ],
          "group_label": "Usergroups",
        },
      ],
      "updatedAt": "2019-11-06 09:42:45 +0100",
      "value": "2-Usergroups",
    },
  ],
  "Setting::Puppet": Array [
    Object {
      "category": "Setting::Puppet",
      "configFile": "settings.yaml",
      "createdAt": "2019-11-06 09:42:45 +0100",
      "default": false,
      "description": "This has no fullName. All hosts will show a configuration status even when a Puppet smart proxy is not assigned",
      "encrypted": false,
      "fullName": null,
      "id": 132,
      "name": "always_show_configuration_status",
      "readonly": false,
      "selectValues": null,
      "settingsType": "boolean",
      "updatedAt": "2019-11-06 09:42:45 +0100",
      "value": false,
    },
  ],
}
`;

exports[`SettingRecordsSelectors should select setting to edit 1`] = `
Object {
  "category": "Setting::Foo",
  "id": 42,
  "name": "edit_me",
}
`;

exports[`SettingRecordsSelectors should select settings by category 1`] = `
Array [
  Object {
    "category": "General",
    "configFile": "settings.yaml",
    "createdAt": "2019-11-06 09:42:45 +0100",
    "default": "root@example.com",
    "description": "The default administrator email address",
    "encrypted": false,
    "fullName": "Administrator email address",
    "id": 36,
    "name": "administrator",
    "readonly": false,
    "selectValues": null,
    "settingsType": "string",
    "updatedAt": "2020-04-29 15:48:23 +0200",
    "value": "root@example.com",
  },
  Object {
    "category": "General",
    "configFile": "settings.yaml",
    "createdAt": "2018-01-22 14:03:38 +0100",
    "default": false,
    "description": "Foreman will append domain names when new hosts are provisioned",
    "encrypted": false,
    "fullName": "Append domain names to the host",
    "id": 177,
    "name": "display_fqdn_for_hosts",
    "readonly": false,
    "selectValues": null,
    "settingsType": "boolean",
    "updatedAt": "2018-01-22 14:03:38 +0100",
    "value": true,
  },
  Object {
    "category": "General",
    "configFile": "settings.yaml",
    "default": null,
    "description": "Timezone to use for new users",
    "encrypted": false,
    "fullName": "Default timezone",
    "id": 27,
    "name": "default_timezone",
    "readonly": false,
    "selectValues": Object {
      "": "Browser timezone",
      "Abu Dhabi": "(GMT +04:00) Abu Dhabi",
      "Adelaide": "(GMT +09:30) Adelaide",
      "Alaska": "(GMT -09:00) Alaska",
      "Almaty": "(GMT +06:00) Almaty",
      "American Samoa": "(GMT -11:00) American Samoa",
      "Amsterdam": "(GMT +01:00) Amsterdam",
      "Arizona": "(GMT -07:00) Arizona",
      "Astana": "(GMT +06:00) Astana",
      "Athens": "(GMT +02:00) Athens",
      "Atlantic Time (Canada)": "(GMT -04:00) Atlantic Time (Canada)",
      "Auckland": "(GMT +12:00) Auckland",
      "Azores": "(GMT -01:00) Azores",
      "Baghdad": "(GMT +03:00) Baghdad",
      "Baku": "(GMT +04:00) Baku",
      "Bangkok": "(GMT +07:00) Bangkok",
    },
    "settingsType": null,
    "value": "Bangkok",
  },
  Object {
    "category": "General",
    "configFile": "settings.yaml",
    "createdAt": "2019-11-06 09:42:45 +0100",
    "default": Array [],
    "description": "Set hostnames to which requests are not to be proxied. Requests to the local host are excluded by default.",
    "encrypted": false,
    "fullName": "HTTP(S) proxy except hosts",
    "id": 47,
    "name": "http_proxy_except_list",
    "readonly": false,
    "selectValues": null,
    "settingsType": "array",
    "updatedAt": "2020-03-20 13:44:40 +0100",
    "value": Array [
      "localhost",
      "127.0.0.1",
    ],
  },
]
`;