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

Icon refactoring and Summary spacing fix #6951

Merged
merged 5 commits into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 9 additions & 7 deletions frontend/cypress/integration/common/graph_display.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Before(() => {
When('user graphs {string} namespaces', namespaces => {
// Forcing "Pause" to not cause unhandled promises from the browser when cypress is testing
cy.intercept(`**/api/namespaces/graph*`).as('graphNamespaces');
cy.visit(url + `/graph/namespaces?refresh=0&namespaces=${namespaces}`);
cy.visit(`${url}/graph/namespaces?refresh=0&namespaces=${namespaces}`);
if (namespaces !== '') {
cy.wait('@graphNamespaces');
}
Expand Down Expand Up @@ -111,7 +111,7 @@ Then(`user sees empty graph`, () => {
});

Then(`user sees the {string} namespace`, ns => {
cy.get('div#summary-panel-graph').find('div#summary-panel-graph-heading').find(`span#ns-${ns}`).should('be.visible');
cy.get('div#summary-panel-graph').find('div#summary-panel-graph-heading').find(`div#ns-${ns}`).should('be.visible');
});

Then('the display menu opens', () => {
Expand Down Expand Up @@ -321,7 +321,7 @@ Then('{string} option {string} in the graph', (option: string, action: string) =
validateInput(option, action);
});

And('the {string} option should {string} and {string}', (option:string, optionState:string, checkState:string) => {
And('the {string} option should {string} and {string}', (option: string, optionState: string, checkState: string) => {
switch (option) {
case 'operation nodes':
option = 'filterOperationNodes';
Expand All @@ -332,11 +332,13 @@ And('the {string} option should {string} and {string}', (option:string, optionSt
default:
option = 'xxx';
}
cy.get('div#graph-display-menu').find(`input#${option}`).should(optionState.replaceAll(' ','.')).and(`be.${checkState}`);
cy.get('div#graph-display-menu')
.find(`input#${option}`)
.should(optionState.replaceAll(' ', '.'))
.and(`be.${checkState}`);
});


And('only a single cluster box should be visible',() =>{
And('only a single cluster box should be visible', () => {
cy.waitForReact();
cy.getReact('CytoscapeGraph')
.should('have.length', '1')
Expand All @@ -349,7 +351,7 @@ And('only a single cluster box should be visible',() =>{
});
});

function validateInput(option: string, action: string) {
function validateInput(option: string, action: string): void {
if (action.startsWith('appear')) {
cy.get('div#graph-display-menu')
.find(`input#${option}`)
Expand Down
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"cypress:delete:reports": "rm cypress/results/* || true",
"cypress:combine:reports": "jrm cypress/results/combined-report.xml \"cypress/results/*.xml\"",
"lint": "eslint --ext js,ts,tsx src",
"lint:precommit": "eslint -c .eslintrc_precommit $(git diff --staged --name-only HEAD | grep -E '\\.tsx?$' | cut -d'/' -f2-)",
"lint:precommit": "eslint -c .eslintrc_precommit $(git diff --staged --name-only HEAD --diff-filter=AM | grep -E '\\.tsx?$' | cut -d'/' -f2-)",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Filter added to apply precommit lint only to added and modified files (it was throwing lint error because of deleted file)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like these author-written review comments, it's helpful without having to add comments in the code.

"lint:fix": "eslint --ext js,ts,tsx --fix src",
"start": "if [ \"${KIALI_ENV}\" = \"production\" ]; then npm run start:prod; else npm run start:dev; fi",
"start:dev": "sh -ac '. ./.env.upstream; npm run start:kiali'",
Expand Down