Skip to content

Commit 16e8c46

Browse files
committed
Upgrades to Patternfly 6
1 parent 300b4be commit 16e8c46

File tree

129 files changed

+5232
-6029
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

129 files changed

+5232
-6029
lines changed

__mocks__/keycloak-js.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// __mocks__/keycloak-js.js
2+
3+
// Mock implementation of the Keycloak class
4+
const Keycloak = jest.fn(() => ({
5+
init: jest.fn().mockResolvedValue(true), // Mocks successful initialization
6+
login: jest.fn().mockResolvedValue(true), // Mocks successful login
7+
logout: jest.fn().mockResolvedValue(true), // Mocks successful logout
8+
authenticated: true, // Mocks that the user is authenticated
9+
accountManagement: jest.fn(), // Mocks account management
10+
token: 'mock-token', // Mocks a token
11+
updateToken: jest.fn().mockResolvedValue(true), // Mocks token refresh
12+
authServerUrl: 'http://mock-server-url', // Mocks the auth server URL
13+
realm: 'mock-realm', // Mocks the realm
14+
}));
15+
16+
// Export the mock class
17+
module.exports = Keycloak;

cypress/e2e/1_cluster-welcome.cy.js

Lines changed: 3 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -44,46 +44,13 @@ describe('Welcome page', () => {
4444
cy.contains('Data container');
4545
cy.contains('Running'); // cluster status
4646

47-
//Checks if navigation menu is hidden
48-
cy.contains('Data Container').should('not.be.visible');
49-
cy.contains('Global Statistics').should('not.be.visible');
50-
cy.contains('Cluster Membership').should('not.be.visible');
51-
52-
cy.get('#nav-toggle').click();
47+
cy.get('[data-cy=sideBarToggle]').click();
5348
//Checks if navigation menu is visible
5449
cy.contains('Data Container').should('be.visible');
5550
cy.contains('Global Statistics').should('be.visible');
5651
cy.contains('Cluster Membership').should('be.visible');
57-
58-
//Clicks the Cluster Membership link and should go to Cluster Membership page
59-
cy.contains('Cluster Membership').click();
60-
cy.contains('Cluster membership').should('be.visible');
61-
cy.contains('Healthy');
62-
cy.contains('infinispan-4-e2e');
63-
64-
//Clicks the Global statistics link and should go to Global statistics page
65-
cy.contains('Global Statistics').click();
66-
cy.contains('Global statistics').should('be.visible');
67-
cy.contains('Cluster-wide statistics');
68-
cy.contains('Cache Manager lifecycle values');
69-
70-
//Clicks the Access management link and should go to Access management page
71-
cy.contains('Access Management').click();
72-
cy.contains('Access management').should('be.visible');
73-
cy.contains('Access control');
74-
cy.contains('Create role');
75-
76-
//Clicks the Connected clients link and should go to Connected clients page
77-
cy.contains('Connected Clients').click();
78-
cy.contains('Connected clients').should('be.visible');
79-
cy.contains('Client library');
80-
cy.contains('Server node');
81-
82-
//Clicks the Data Container link and should go to Data Container page
83-
cy.contains('Data Container').click();
84-
cy.contains('Data container').should('be.visible');
85-
cy.contains('Running'); // cluster status
86-
cy.contains('Cluster rebalancing on'); // rebalancing status
52+
cy.contains('Access Management').should('be.visible');
53+
cy.contains('Connected Clients').should('be.visible');
8754
});
8855

8956
it('successfully opens and views About page', () => {

cypress/e2e/1_data-container.cy.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ describe('Data Container Overview', () => {
1111
cy.contains('Running'); // cluster status
1212
cy.contains('Tracing is enabled');
1313
cy.contains('Cluster rebalancing on'); // rebalancing status
14-
cy.get('#cluster-manager-header').should('exist');
14+
cy.get('[data-cy=cluster-manager-header]').should('exist');
1515
cy.get('[data-cy=cacheManagerStatus]').should('exist');
1616
cy.get('[data-cy=rebalancingSwitch]').should('exist');
1717
cy.get('[data-cy=navigationTabs]').should('exist');
@@ -310,7 +310,7 @@ describe('Data Container Overview', () => {
310310
cy.get('[data-cy=dataContainerLink]').click(); //Clicking on breadcrumb link.
311311

312312
//Is redirected to Data Container page
313-
cy.get('#cluster-manager-header').should('exist');
313+
cy.get('[data-cy=cluster-manager-header]').should('exist');
314314
cy.get('[data-cy=cacheManagerStatus]').should('exist');
315315
cy.get('[data-cy=rebalancingSwitch]').should('exist');
316316

cypress/e2e/1_rbac_func.cy.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ describe('RBAC Functionality Tests', () => {
121121
cy.get('[data-cy=rebalancingSwitch]').should('not.exist'); // rebalancing status
122122
}
123123

124-
cy.get('#cluster-manager-header').should('exist');
124+
cy.get('[data-cy=cluster-manager-header]').should('exist');
125125
cy.get('[data-cy=cacheManagerStatus]').should('exist');
126126
cy.get('[data-cy=navigationTabs]').should('exist');
127127
cy.contains(/^\d+ Caches$/);
@@ -344,7 +344,7 @@ describe('RBAC Functionality Tests', () => {
344344
cy.get('button[aria-label="Show Filters"]').click();
345345
}
346346
})
347-
347+
348348
cy.get('[data-cy=counterFilterSelectExpanded]').should('exist');
349349
//Checking delete counter functionality
350350
cy.contains('td', 'strong-1').parent()

cypress/e2e/3_cache-crud-wizard.cy.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ describe('Cache Creation Wizard', () => {
105105
cy.get('[data-cy=option-typeahead-persistence]').click();
106106
cy.get('[data-cy=menu-toogle-categorySelector]').click();
107107

108-
//Filling alias
108+
//Filling alias
109109
cy.get('[data-cy=menu-toogle-aliasesSelector]').click().type('securedAlias').type('{enter}');
110110

111111
// Next
@@ -135,7 +135,7 @@ describe('Cache Creation Wizard', () => {
135135
cy.get('[data-cy=wizardNextButton]').click();
136136

137137
// Once the cache created, redirection to main page is done and the cache should be visible
138-
cy.get('#cluster-manager-header').should('exist');
138+
cy.get('[data-cy=cluster-manager-header]').should('exist');
139139
cy.get('[data-cy=cacheManagerStatus]').should('exist');
140140
cy.get('[data-cy=rebalancingSwitch]').should('exist');
141141
cy.contains('asuper-cache');
@@ -167,7 +167,7 @@ describe('Cache Creation Wizard', () => {
167167
cy.contains('Cache ' + cacheName + ' successfully created with e2e-test-template.');
168168
// Once the cache created, redirection to main page is done and the cache should be visible
169169
//Is redirected to Data Container page
170-
cy.get('#cluster-manager-header').should('exist');
170+
cy.get('[data-cy=cluster-manager-header]').should('exist');
171171
cy.get('[data-cy=cacheManagerStatus]').should('exist');
172172
cy.get('[data-cy=rebalancingSwitch]').should('exist');
173173
cy.contains(cacheName);
@@ -195,7 +195,7 @@ describe('Cache Creation Wizard', () => {
195195
cy.get('[data-cy=wizardNextButton]').click();
196196
cy.contains('Cache aSimpleCache created with the provided configuration.');
197197
// Once the cache created, redirection to main page is done and the cache should be visible
198-
cy.get('#cluster-manager-header').should('exist');
198+
cy.get('[data-cy=cluster-manager-header]').should('exist');
199199
cy.get('[data-cy=cacheManagerStatus]').should('exist');
200200
cy.get('[data-cy=rebalancingSwitch]').should('exist');
201201
cy.contains('aSimpleCache');
@@ -229,7 +229,7 @@ describe('Cache Creation Wizard', () => {
229229
cy.get('[data-cy=wizardNextButton]').click();
230230
cy.contains('Cache aSimpleXmlCache created with the provided configuration.');
231231
// Once the cache created, redirection to main page is done and the cache should be visible
232-
cy.get('#cluster-manager-header').should('exist');
232+
cy.get('[data-cy=cluster-manager-header]').should('exist');
233233
cy.get('[data-cy=cacheManagerStatus]').should('exist');
234234
cy.get('[data-cy=rebalancingSwitch]').should('exist');
235235
cy.contains('aSimpleXmlCache');

cypress/support/commands.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@ Cypress.Commands.add('login', (username, password, url = '/') => {
3434
password: password
3535
}
3636
});
37-
cy.get('#nav-toggle').click();
37+
cy.get('[data-cy=sideBarToggle]').click();
3838
});

jest.config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,15 @@ module.exports = {
2424
"@app/(.*)": '<rootDir>/src/app/$1',
2525
'@services/(.*)': '<rootDir>/src/services/$1',
2626
'@utils/(.*)': '<rootDir>/src/app/utils/$1',
27+
'^keycloak-js$': '<rootDir>/__mocks__/keycloak-js.js',
2728
},
2829

2930
// A preset that is used as a base for Jest's configuration
3031
preset: 'ts-jest/presets/js-with-ts',
3132
setupFilesAfterEnv: ['<rootDir>/test-setup.js'],
3233

34+
transformIgnorePatterns: ['/node_modules/(?!(react-syntax-highlighter)/)'],
35+
3336
// The test environment that will be used for testing.
34-
transformIgnorePatterns: ['/node_modules/(?!(react-syntax-highlighter|keycloak-js)/)'],
3537
testEnvironment: "jsdom",
3638
};

0 commit comments

Comments
 (0)