From 76ce4d7e0a8ed1be63764e9b4740802493a95a8e Mon Sep 17 00:00:00 2001 From: Georgii Karataev Date: Wed, 15 Nov 2023 12:56:03 +0100 Subject: [PATCH] fix: Don't request for unknown staleness in tags The "unknown" option for host staleness is deprecated. --- src/Utilities/constants.js | 2 +- src/api/tagsApi.test.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Utilities/constants.js b/src/Utilities/constants.js index 7e97bed38..7db5900bc 100644 --- a/src/Utilities/constants.js +++ b/src/Utilities/constants.js @@ -255,7 +255,7 @@ export const generateFilter = ( }, ].filter(Boolean); -export const allStaleFilters = ['fresh', 'stale', 'stale_warning', 'unknown']; +export const allStaleFilters = ['fresh', 'stale', 'stale_warning']; export const hybridInventoryTabKeys = { conventional: { diff --git a/src/api/tagsApi.test.js b/src/api/tagsApi.test.js index 282757af8..cd6cce5df 100644 --- a/src/api/tagsApi.test.js +++ b/src/api/tagsApi.test.js @@ -8,7 +8,7 @@ describe('getAllTags', () => { it('should generate get all tags call', async () => { // eslint-disable-next-line max-len const params = - '?order_by=tag&order_how=ASC&per_page=10&page=1&staleness=fresh&staleness=stale&staleness=stale_warning&staleness=unknown'; + '?order_by=tag&order_how=ASC&per_page=10&page=1&staleness=fresh&staleness=stale&staleness=stale_warning'; mockedTags .onGet(`/api/inventory/v1/tags${params}`) .replyOnce(200, { test: 'test' }); @@ -19,7 +19,7 @@ describe('getAllTags', () => { it('should generate get all tags call with search', async () => { // eslint-disable-next-line max-len const params = - '?order_by=tag&order_how=ASC&per_page=10&page=1&staleness=fresh&staleness=stale&staleness=stale_warning&staleness=unknown&search=something'; + '?order_by=tag&order_how=ASC&per_page=10&page=1&staleness=fresh&staleness=stale&staleness=stale_warning&search=something'; mockedTags .onGet(`/api/inventory/v1/tags${params}`) .replyOnce(200, { test: 'test' }); @@ -31,7 +31,7 @@ describe('getAllTags', () => { it('should generate get all tags call with perPage', async () => { // eslint-disable-next-line max-len const params = - '?order_by=tag&order_how=ASC&per_page=50&page=1&staleness=fresh&staleness=stale&staleness=stale_warning&staleness=unknown'; + '?order_by=tag&order_how=ASC&per_page=50&page=1&staleness=fresh&staleness=stale&staleness=stale_warning'; mockedTags .onGet(`/api/inventory/v1/tags${params}`) .replyOnce(200, { test: 'test' }); @@ -44,7 +44,7 @@ describe('getAllTags', () => { it('should generate get all tags call with page', async () => { // eslint-disable-next-line max-len const params = - '?order_by=tag&order_how=ASC&per_page=10&page=20&staleness=fresh&staleness=stale&staleness=stale_warning&staleness=unknown'; + '?order_by=tag&order_how=ASC&per_page=10&page=20&staleness=fresh&staleness=stale&staleness=stale_warning'; mockedTags .onGet(`/api/inventory/v1/tags${params}`) .replyOnce(200, { test: 'test' });