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

EES-5544 Change data set import page accordions into a table #5459

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from

Conversation

bennettstuart
Copy link
Collaborator

@bennettstuart bennettstuart commented Dec 12, 2024

@bennettstuart bennettstuart marked this pull request as ready for review December 12, 2024 13:32
@bennettstuart bennettstuart marked this pull request as draft December 12, 2024 16:19
@bennettstuart bennettstuart marked this pull request as ready for review December 20, 2024 14:42
Comment on lines +5 to +6
padding-bottom: govuk-spacing(2);
padding-top: govuk-spacing(2);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not sure we need this padding?

The default td styling already includes identical vertical padding so this seems redudnant.

Comment on lines +10 to +21
.fileSize {
width: 5rem;
text-align: right;
}

.fileStatus {
max-width: 164px;
}

.actions {
margin-bottom: 0;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

As we're using CSS modules, no need to nest these under the table class. They can be hoisted to the top-level instead.

<tbody>
{dataFiles.map(dataFile => (
<tr key={dataFile.title}>
<td data-testid="Subject title">{dataFile.title}</td>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Might be good to add a max-width to this column to stop longer titles pushing everything so far to the right.

image

It'd be nice to stop the action buttons wrapping e.g.

image

<table className={styles.table} data-testid="Data files table">
<thead>
<tr>
<th scope="col">Subject title</th>
Copy link
Collaborator

Choose a reason for hiding this comment

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

We've moved away from referencing things as 'subject' quite a while (like years) ago but never got around to updating the data uploads page to reflect this.

Would suggest that we change this to just 'Title' and also update other parts of the UI accordingly as well e.g.

The upload form's title input field:

image

The details modal:

image

/>
</td>
<td data-testid="Actions">
<ButtonGroup className={styles.actions}>
Copy link
Collaborator

Choose a reason for hiding this comment

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

At smaller screen sizes, having the buttons in a row quickly breaks down:

image

We should style the group so that it moves into the column layout sooner:

image

Comment on lines +121 to +128
releaseDataFileService
.getDeleteDataFilePlan(releaseId, dataFile)
.then(plan => {
setDeleteDataFile({
plan,
file: dataFile,
});
});
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can rewrite to use awaits

user checks headed table body row contains Data file size 141 Kb ${section}
user checks headed table body row contains Number of rows 612 ${section}
user checks headed table body row contains Status Complete ${section} %{WAIT_DATA_FILE_IMPORT}
user checks table cell contains row=1 column=1 expected=Absence in PRUs parent=testid:Data files table
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why use named parameters? This is pretty inconsistent with how we typically use keywords. Including the parameter names makes the lines much more noisy and hinders readability.

In generally, we use named parameters sparingly throughout the tests e.g. to set optional parameters. We don't usually use them for required parameters like this.

Would revert back to using positional arguments only. Same applies for rest of Robot tests where we've made this change.

Comment on lines +584 to +589
${row}= user gets table row row_cell_text=${SUBJECT_NAME} parent=testid:Data files table
... wait=%{WAIT_SMALL}
${status_cell}= user gets testid element id=Status wait=%{WAIT_SMALL} parent=${row}
user scrolls to element ${status_cell}
user waits until element contains element=${status_cell} text=${IMPORT_STATUS}
... wait=%{WAIT_DATA_FILE_IMPORT}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Similar to earlier comment - would switch back to using positional arguments for required parameters.

@@ -23,9 +23,10 @@ user checks table row heading contains
user waits until element contains xpath://table/tbody/tr[${row}]/th[${column}] ${expected}

user checks table cell contains
[Arguments] ${row} ${column} ${expected} ${parent}=css:table
[Arguments] ${row} ${column} ${expected} ${parent}=css:table ${wait}=%{WAIT_SMALL}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this need a wait? Typically, we could use some other keyword to check that the table (or something in it) has rendered before checking the table cells.

Most 'check' keywords don't include waits for this reason, so this is fairly inconsistent.

@@ -58,7 +59,8 @@ user gets table row with heading
[Return] ${elem}

user gets table row
[Arguments] ${row_cell_text} ${parent}=css:table
[Arguments] ${row_cell_text} ${parent}=css:table ${wait}=%{WAIT_SMALL}
Copy link
Collaborator

Choose a reason for hiding this comment

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

As above comment - does this need a wait? Similarly, we should be able to use some other keyword to wait for the table (or something in it) before checking table rows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants