Skip to content

Commit

Permalink
test: add queue row expansion test
Browse files Browse the repository at this point in the history
  • Loading branch information
ismay committed Nov 16, 2023
1 parent b666038 commit 7ad94fc
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 4 deletions.
2 changes: 2 additions & 0 deletions cypress/integration/list/list-queues.feature
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ Feature: Queues should be listed
Given a queue exists
And the user navigated to the list page
Then the queue is rendered as tabular data
And the user clicks the expand button
Then the queued jobs are shown
9 changes: 9 additions & 0 deletions cypress/integration/list/list-queues/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,12 @@ Given('the user navigated to the list page', () => {
Then('the queue is rendered as tabular data', () => {
cy.findByRole('rowheader', { name: 'Queue' }).should('exist')
})

Given('the user clicks the expand button', () => {
cy.findByRole('button', { name: 'Show jobs' }).click()
})

Then('the queued jobs are shown', () => {
cy.findByRole('rowheader', { name: 'Job 1' }).should('exist')
cy.findByRole('rowheader', { name: 'Job 2' }).should('exist')
})
10 changes: 8 additions & 2 deletions i18n/en.pot
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ msgstr ""
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
"POT-Creation-Date: 2023-11-08T08:39:40.580Z\n"
"PO-Revision-Date: 2023-11-08T08:39:40.580Z\n"
"POT-Creation-Date: 2023-11-16T13:48:39.789Z\n"
"PO-Revision-Date: 2023-11-16T13:48:39.789Z\n"

msgid "Something went wrong"
msgstr "Something went wrong"
Expand Down Expand Up @@ -189,6 +189,12 @@ msgstr "No jobs to display"
msgid "Not scheduled"
msgstr "Not scheduled"

msgid "Hide jobs"
msgstr "Hide jobs"

msgid "Show jobs"
msgstr "Show jobs"

msgid "Queue"
msgstr "Queue"

Expand Down
4 changes: 3 additions & 1 deletion src/components/JobTable/ExpandableRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ const ExpandableRow = ({ job }) => {
return (
<TableRow className={styles.row} suppressZebraStriping>
<TableCell />
<TableCell className={styles.indent}>{job.name}</TableCell>
<TableCell role="rowheader" className={styles.indent}>
{job.name}
</TableCell>
<TableCell className={styles.indent} colSpan="6">
{jobTypesMap[job.type]}
</TableCell>
Expand Down
8 changes: 7 additions & 1 deletion src/components/JobTable/QueueTableRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,13 @@ const QueueTableRow = ({
<>
<TableRow>
<TableCell>
<button className={styles.button} onClick={handleClick}>
<button
className={styles.button}
onClick={handleClick}
title={
showJobs ? i18n.t('Hide jobs') : i18n.t('Show jobs')
}
>
{showJobs ? <IconChevronUp24 /> : <IconChevronDown24 />}
</button>
</TableCell>
Expand Down

0 comments on commit 7ad94fc

Please sign in to comment.