Skip to content

Commit 365b638

Browse files
authored
flx: gc history ttl display error (#554)
* GC history TTL display error Signed-off-by: zhaoxinxin <1186037180@qq.com> * GC history TTL display error Signed-off-by: zhaoxinxin <1186037180@qq.com> --------- Signed-off-by: zhaoxinxin <1186037180@qq.com>
1 parent 9e08366 commit 365b638

File tree

4 files changed

+18
-5
lines changed

4 files changed

+18
-5
lines changed

cypress/e2e/gc/audit.cy.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,19 @@ describe('audit', () => {
3636
});
3737

3838
it('when data is loaded', () => {
39+
// Show audit ttl.
3940
cy.get('#audit-ttl').should('have.text', '3 days');
4041

42+
// Show gc history.
4143
cy.get('#history').should('have.text', '11');
44+
4245
cy.get('#pagination').should('exist');
4346

47+
// Display gc history information.
4448
cy.get('#trigger-119').should('have.text', 'Manual');
49+
cy.get('#ttl-119').should('have.text', '2 days');
4550

51+
// Go to next page.
4652
cy.get('.MuiPagination-ul > :nth-child(3) > .MuiButtonBase-root').click();
4753

4854
cy.get('#id-97').should('have.text', 97);

cypress/e2e/gc/job.cy.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,22 @@ describe('audit', () => {
3636
});
3737

3838
it('when data is loaded', () => {
39+
// Displays the Job ttl.
3940
cy.get('#job-ttl').should('have.text', '13 days');
4041

42+
// Displays the GC history.
4143
cy.get('#history').should('have.text', '13');
4244
cy.get('#pagination').should('exist');
4345

46+
// Display gc history information.
4447
cy.get('#trigger-117').should('have.text', 'Manual');
4548

4649
// Go to last page.
4750
cy.get('.MuiPagination-ul > :nth-child(3) > .MuiButtonBase-root').click();
4851

52+
// Display gc history information.
4953
cy.get('#id-101').should('have.text', 101);
54+
cy.get('#ttl-101').should('have.text', '13 days');
5055
});
5156

5257
it('when no data is loaded', () => {

src/components/gc/audit/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -732,7 +732,7 @@ export default function AuditGC() {
732732
</TableCell>
733733
<TableCell align="center" id={`ttl-${item?.id}`}>
734734
<Typography variant="body1" component="div">
735-
{ms(item?.args?.ttl / 100000, { long: true })}
735+
{ms(item?.args?.ttl / 1000000, { long: true }) || 0}
736736
</Typography>
737737
</TableCell>
738738
<TableCell align="center" id={`purged-${item?.port}`}>

src/components/gc/job/index.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -731,12 +731,12 @@ export default function JobGC() {
731731
}}
732732
/>
733733
</TableCell>
734-
<TableCell align="center" id={`ip-${item?.id}`}>
734+
<TableCell align="center" id={`ttl-${item?.id}`}>
735735
<Typography variant="body1" component="div">
736-
{ms(item?.args?.ttl / 100000, { long: true })}
736+
{ms(item?.args?.ttl / 1000000, { long: true }) || 0}
737737
</Typography>
738738
</TableCell>
739-
<TableCell align="center" id={`port-${item?.port}`}>
739+
<TableCell align="center" id={`purged-${item?.port}`}>
740740
<Typography variant="body1" fontFamily="mabry-bold" component="div">
741741
{item?.result?.purged}
742742
</Typography>
@@ -761,7 +761,9 @@ export default function JobGC() {
761761
{item?.state}
762762
</Box>
763763
</TableCell>
764-
<TableCell align="center">{getDatetime(item.created_at)}</TableCell>
764+
<TableCell align="center" id={`create-at-${item?.id}`}>
765+
{getDatetime(item.created_at)}
766+
</TableCell>
765767
</TableRow>
766768
);
767769
})}

0 commit comments

Comments
 (0)