Skip to content

Commit

Permalink
fix(config): align product filter tests (#1049)
Browse files Browse the repository at this point in the history
  • Loading branch information
cdcabrera authored Feb 7, 2023
1 parent d21031d commit a8e3c9f
Show file tree
Hide file tree
Showing 12 changed files with 824 additions and 204 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -211,15 +211,69 @@ exports[`Product OpenShift Container config should apply guest inventory configu
}
`;

exports[`Product OpenShift Container config should apply guest inventory configuration: filtered, missing inventory id 1`] = `
{
"cells": [
{
"title": "lorem",
},
{
"title": "",
},
{
"title": <DateFormat
date="2022-01-01T00:00:00.000Z"
/>,
},
],
"columnHeaders": [
{
"title": "t(curiosity-inventory.header, {"context":"guestsDisplayName"})",
"transforms": [],
},
{
"title": "t(curiosity-inventory.header, {"context":"inventoryId"})",
"transforms": [
[Function],
],
},
{
"title": "t(curiosity-inventory.header, {"context":"lastSeen"})",
"transforms": [
[Function],
],
},
],
"data": {
"displayName": {
"title": "t(curiosity-inventory.header, {"context":"displayName"})",
"value": "lorem",
},
"inventoryId": {
"title": "t(curiosity-inventory.header, {"context":"inventoryId"})",
"value": "",
},
"lastSeen": {
"title": "t(curiosity-inventory.header, {"context":"lastSeen"})",
"value": "2022-01-01T00:00:00.000Z",
},
"loremIpsum": {
"title": "t(curiosity-inventory.header, {"context":"loremIpsum"})",
"value": "hello world",
},
"subscriptionManagerId": {
"title": "t(curiosity-inventory.header, {"context":"subscriptionManagerId"})",
"value": "lorem subscription id",
},
},
}
`;

exports[`Product OpenShift Container config should apply hosts inventory configuration: filtered 1`] = `
{
"cells": [
{
"title": <React.Fragment>
lorem
t(curiosity-inventory.label, {"context":"numberOfGuests","count":3}, [object Object])
</React.Fragment>,
"title": "lorem",
},
{
"title": 100,
Expand Down Expand Up @@ -268,7 +322,7 @@ exports[`Product OpenShift Container config should apply hosts inventory configu
},
"inventory_id": {
"title": "t(curiosity-inventory.header_inventory_id, {"context":"OpenShift Container Platform"})",
"value": "lorem inventory id",
"value": "",
},
"last_seen": {
"title": "t(curiosity-inventory.header_last_seen, {"context":"OpenShift Container Platform"})",
Expand All @@ -290,6 +344,92 @@ exports[`Product OpenShift Container config should apply hosts inventory configu
}
`;

exports[`Product OpenShift Container config should apply hosts inventory configuration: filtered, authorized 1`] = `
{
"cells": [
{
"title": <React.Fragment>
<Button
component="a"
href="/insights/inventory/XXXX-XXXX-XXXXX-XXXXX/"
isInline={true}
variant="link"
>
lorem
</Button>
t(curiosity-inventory.label, {"context":"numberOfGuests","count":3}, [object Object])
</React.Fragment>,
},
{
"title": 100,
},
{
"title": 20,
},
{
"title": <DateFormat
date="2022-01-01T00:00:00.000Z"
/>,
},
],
"columnHeaders": [
{
"title": "t(curiosity-inventory.header_display, {"context":"name"})",
"transforms": [],
},
{
"title": "t(curiosity-inventory.header, {"context":"sockets"})",
"transforms": [
[Function],
],
},
{
"title": "t(curiosity-inventory.header, {"context":"cores"})",
"transforms": [
[Function],
],
},
{
"title": "t(curiosity-inventory.header_last, {"context":"seen"})",
"transforms": [
[Function],
],
},
],
"data": {
"cores": {
"title": "t(curiosity-inventory.header, {"context":"cores"})",
"value": 20,
},
"display_name": {
"title": "t(curiosity-inventory.header_display, {"context":"name"})",
"value": "lorem",
},
"inventory_id": {
"title": "t(curiosity-inventory.header_inventory, {"context":"id"})",
"value": "XXXX-XXXX-XXXXX-XXXXX",
},
"last_seen": {
"title": "t(curiosity-inventory.header_last, {"context":"seen"})",
"value": "2022-01-01T00:00:00.000Z",
},
"loremIpsum": {
"title": "t(curiosity-inventory.header, {"context":"loremIpsum"})",
"value": "hello world",
},
"number_of_guests": {
"title": "t(curiosity-inventory.header_number_of, {"context":"guests"})",
"value": 3,
},
"sockets": {
"title": "t(curiosity-inventory.header, {"context":"sockets"})",
"value": 100,
},
},
}
`;

exports[`Product OpenShift Container config should apply hosts inventory configuration: filtered, fallback display 1`] = `
{
"cells": [
Expand Down Expand Up @@ -363,6 +503,85 @@ exports[`Product OpenShift Container config should apply hosts inventory configu
}
`;

exports[`Product OpenShift Container config should apply hosts inventory configuration: filtered, infinite 1`] = `
{
"cells": [
{
"title": "lorem",
},
{
"title": 100,
},
{
"title": 20,
},
{
"title": <DateFormat
date="2022-01-01T00:00:00.000Z"
/>,
},
],
"columnHeaders": [
{
"title": "t(curiosity-inventory.header_display, {"context":"name"})",
"transforms": [],
},
{
"title": "t(curiosity-inventory.header, {"context":"sockets"})",
"transforms": [
[Function],
],
},
{
"title": "t(curiosity-inventory.header, {"context":"cores"})",
"transforms": [
[Function],
],
},
{
"title": "t(curiosity-inventory.header_last, {"context":"seen"})",
"transforms": [
[Function],
],
},
],
"data": {
"cores": {
"title": "t(curiosity-inventory.header, {"context":"cores"})",
"value": 20,
},
"display_name": {
"title": "t(curiosity-inventory.header_display, {"context":"name"})",
"value": "lorem",
},
"has_infinite_quantity": {
"title": "t(curiosity-inventory.header_has_infinite, {"context":"quantity"})",
"value": false,
},
"inventory_id": {
"title": "t(curiosity-inventory.header_inventory, {"context":"id"})",
"value": "",
},
"last_seen": {
"title": "t(curiosity-inventory.header_last, {"context":"seen"})",
"value": "2022-01-01T00:00:00.000Z",
},
"loremIpsum": {
"title": "t(curiosity-inventory.header, {"context":"loremIpsum"})",
"value": "hello world",
},
"number_of_guests": {
"title": "t(curiosity-inventory.header_number_of, {"context":"guests"})",
"value": 3,
},
"sockets": {
"title": "t(curiosity-inventory.header, {"context":"sockets"})",
"value": 100,
},
},
}
`;

exports[`Product OpenShift Container config should apply subscriptions inventory configuration: filtered 1`] = `
{
"cells": [
Expand Down
4 changes: 2 additions & 2 deletions src/config/__tests__/__snapshots__/product.rhacs.test.js.snap
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Product RHACS config should apply an instances inventory configuration under hosts: filtered 1`] = `
exports[`Product RHACS config should apply an inventory configuration: filtered 1`] = `
{
"cells": [
{
Expand Down Expand Up @@ -59,7 +59,7 @@ exports[`Product RHACS config should apply an instances inventory configuration
}
`;

exports[`Product RHACS config should apply an instances inventory configuration under hosts: filtered, authorized 1`] = `
exports[`Product RHACS config should apply an inventory configuration: filtered, authorized 1`] = `
{
"cells": [
{
Expand Down
Loading

0 comments on commit a8e3c9f

Please sign in to comment.