Skip to content

Commit

Permalink
Merge branch 'master' into essntl-3727-display-group-systems
Browse files Browse the repository at this point in the history
  • Loading branch information
gkarat authored Mar 13, 2023
2 parents 3157b36 + 0c3682e commit 51c8c70
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 23 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
## [1.9.1](https://github.com/RedHatInsights/insights-inventory-frontend/compare/v1.9.0...v1.9.1) (2023-03-13)

# [1.9.0](https://github.com/RedHatInsights/insights-inventory-frontend/compare/v1.8.0...v1.9.0) (2023-03-13)


Expand Down
69 changes: 49 additions & 20 deletions cypress/support/interceptors.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,29 @@ import groupDetailFixtures from '../fixtures/groups/620f9ae75A8F6b83d78F3B55Af1c

export const groupsInterceptors = {
'successful with some items': () =>
cy.intercept('GET', '/api/inventory/v1/groups*', fixtures).as('getGroups'),
cy
.intercept('GET', '/api/inventory/v1/groups*', {
statusCode: 200,
body: fixtures
})
.as('getGroups'),
'successful with some items second page': () =>
cy.intercept('GET', '/api/inventory/v1/groups?*page=2&perPage=50*', groupsSecondPage).as('getGroupsSecond'),
cy
.intercept('GET', '/api/inventory/v1/groups?*page=2&perPage=50*', {
statusCode: 200,
body: groupsSecondPage
})
.as('getGroupsSecond'),
'successful empty': () =>
cy
.intercept('GET', '/api/inventory/v1/groups*', {
count: 0,
page: 1,
per_page: DEFAULT_ROW_COUNT,
total: 0
statusCode: 200,
body: {
count: 0,
page: 1,
per_page: DEFAULT_ROW_COUNT,
total: 0
}
})
.as('getGroups'),
'failed with server error': () => {
Expand All @@ -27,39 +40,55 @@ export const groupsInterceptors = {
);
},
'long responding': () => {
cy.intercept('GET', '/api/inventory/v1/groups*', (req) => {
req.reply({
body: fixtures,
delay: 42000000 // milliseconds
});
cy.intercept('GET', '/api/inventory/v1/groups*', {
statusCode: 200,
body: fixtures,
delay: 42000000 // milliseconds
}).as('getGroups');
}
};

export const groupDetailInterceptors = {
successful: () =>
cy
.intercept('GET', '/api/inventory/v1/groups/620f9ae75A8F6b83d78F3B55Af1c4b2C', groupDetailFixtures)
.intercept(
'GET',
'/api/inventory/v1/groups/620f9ae75A8F6b83d78F3B55Af1c4b2C',
{
statusCode: 200,
body: groupDetailFixtures
}
)
.as('getGroupDetail'),
empty: () =>
cy
.intercept('GET', '/api/inventory/v1/groups/620f9ae75A8F6b83d78F3B55Af1c4b2C', { statusCode: 404 })
.intercept(
'GET',
'/api/inventory/v1/groups/620f9ae75A8F6b83d78F3B55Af1c4b2C',
{ statusCode: 404 }
)
.as('getGroupDetail'),
'failed with server error': () => {
Cypress.on('uncaught:exception', () => {
return false;
});
cy.intercept('GET', '/api/inventory/v1/groups/620f9ae75A8F6b83d78F3B55Af1c4b2C', { statusCode: 500 }).as(
'getGroupDetail'
);
cy.intercept(
'GET',
'/api/inventory/v1/groups/620f9ae75A8F6b83d78F3B55Af1c4b2C',
{ statusCode: 500 }
).as('getGroupDetail');
},
'long responding': () => {
cy.intercept('GET', '/api/inventory/v1/groups/620f9ae75A8F6b83d78F3B55Af1c4b2C', (req) => {
req.reply({
cy.intercept(
'GET',
'/api/inventory/v1/groups/620f9ae75A8F6b83d78F3B55Af1c4b2C',
{
statusCode: 200,
body: groupDetailFixtures,
delay: 42000000 // milliseconds
});
}).as('getGroupDetail');
}
)
.as('getGroupDetail');
},
'patch successful': () => {
cy
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "insights-inventory-frontend",
"version": "1.9.0",
"version": "1.9.1",
"private": false,
"engines": {
"node": ">=15.0.0",
Expand Down

0 comments on commit 51c8c70

Please sign in to comment.