Skip to content
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
21 changes: 3 additions & 18 deletions cypress/e2e/peers/peers.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,7 @@ describe('Peers', () => {
});

describe('when data is loaded', () => {
it('displays the total number of peers and git version number, as well as the number of git commit', () => {
// should display the total number of peers.
cy.get('#total').should('have.text', 10);

it('displays the git version number and the number of git commit', () => {
// should display the git version number of peers.
cy.get('#git-version').should('have.text', 4);

Expand Down Expand Up @@ -173,10 +170,7 @@ describe('Peers', () => {
);
});

it('displays the total number of peers and git version number, as well as the number of git commit', () => {
// should display the total number of peers.
cy.get('#total').should('have.text', 0);

it('displays the git version number and the number of git commit', () => {
// should display the git version number of peers.
cy.get('#git-version').should('have.text', 0);

Expand Down Expand Up @@ -214,10 +208,7 @@ describe('Peers', () => {
cy.visit('/clusters/1/peers');
});

it('displays the total number of peers and git version number, as well as the number of git commit', () => {
// should display the total number of peers.
cy.get('#total').should('have.text', 0);

it('displays the git version number and the number of git commit', () => {
// should display the git version number of peers.
cy.get('#git-version').should('have.text', 0);

Expand Down Expand Up @@ -251,7 +242,6 @@ describe('Peers', () => {

describe('refresh', () => {
it('can refresh peers and return new data', () => {
cy.get('#total').should('have.text', 10);
cy.get('#git-version').should('have.text', 4);
cy.get('#git-commit').should('have.text', 5);

Expand Down Expand Up @@ -300,13 +290,11 @@ describe('Peers', () => {

cy.wait(2000);

cy.get('#total').should('have.text', 14);
cy.get('#git-version').should('have.text', 6);
cy.get('#git-commit').should('have.text', 7);
});

it('not can refresh peers and return new data', () => {
cy.get('#total').should('have.text', 10);
cy.get('#git-version').should('have.text', 4);
cy.get('#git-commit').should('have.text', 5);

Expand Down Expand Up @@ -339,13 +327,11 @@ describe('Peers', () => {

cy.get('.MuiAlert-message').should('have.text', 'scheduler cluster id 7: record not found');

cy.get('#total').should('have.text', 10);
cy.get('#git-version').should('have.text', 4);
cy.get('#git-commit').should('have.text', 5);
});

it('can refresh peer fetch data error', () => {
cy.get('#total').should('have.text', 10);
cy.get('#git-version').should('have.text', 4);
cy.get('#git-commit').should('have.text', 5);

Expand Down Expand Up @@ -396,7 +382,6 @@ describe('Peers', () => {
// Show error message.
cy.get('.MuiAlert-message', { timeout: 5000 }).should('be.visible').and('contain', 'Failed to fetch');

cy.get('#total').should('have.text', 10);
cy.get('#git-version').should('have.text', 4);
cy.get('#git-commit').should('have.text', 5);
});
Expand Down
2 changes: 1 addition & 1 deletion src/components/clusters/peers/inde.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
.navigationContainer {
display: grid;
gap: calc(1.5rem);
grid-template-columns: repeat(3, 1fr);
grid-template-columns: repeat(2, 1fr);
margin-bottom: 2rem;
}

Expand Down
27 changes: 0 additions & 27 deletions src/components/clusters/peers/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ import { ReactComponent as RefreshLoading } from '../../../assets/images/cluster
import { ReactComponent as Refresh } from '../../../assets/images/cluster/peer/refresh.svg';
import { ReactComponent as RefreshDialog } from '../../../assets/images/cluster/peer/refresh-dialog.svg';
import { ReactComponent as DeleteWarning } from '../../../assets/images/cluster/delete-warning.svg';
import { ReactComponent as Total } from '../../../assets/images/cluster/peer/total.svg';
import { ReactComponent as GitVersion } from '../../../assets/images/cluster/peer/git-versions.svg';
import { ReactComponent as GitCommit } from '../../../assets/images/cluster/peer/git-commits.svg';
import { ReactComponent as Active } from '../../../assets/images/cluster/peer/active.svg';
Expand Down Expand Up @@ -528,32 +527,6 @@ export default function Peer() {
</Box>
</Box>
<Box className={styles.navigationContainer}>
<Card className={styles.navigationWrapper}>
<Box className={styles.navigationContent}>
<Box>
<Typography variant="subtitle2" fontFamily="mabry-bold" color="var(--palette-table-title-text-color)">
Total
</Typography>
{isLoading ? (
<Skeleton height={40} data-testid="cluster-loading" width="2rem" />
) : (
<Typography id="total" variant="h5" fontFamily="mabry-bold" p="0.5rem 0">
{peer.length}
</Typography>
)}
<Box className={styles.navigationCount}>
<span className={styles.navigationCountIcon}>
<Count />
</span>
<Typography variant="body2" color="var(--palette-table-title-text-color)">
number of peers
</Typography>
</Box>
</Box>
<Box className={styles.navigation}></Box>
<Total className={styles.navigationIcon} />
</Box>
</Card>
<Card className={styles.navigationWrapper}>
<Box className={styles.navigationContent}>
<Box>
Expand Down
Loading