Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(config): align product filter tests #1049

Merged
merged 2 commits into from
Feb 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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