Skip to content

Commit

Permalink
Merge 2a2c21a into 6e44a66
Browse files Browse the repository at this point in the history
  • Loading branch information
MoritzWeber0 authored Oct 7, 2024
2 parents 6e44a66 + 2a2c21a commit e1d17e8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,11 @@ <h1 class="text-lg font-bold">Session File Browser</h1>
<button
mat-icon-button
(click)="node.isExpanded = !node.isExpanded"
[attr.aria-label]="'Expand ' + node.name"
data-testid="folder-button"
[attr.aria-label]="
(node.isExpanded ? 'Collapse ' : 'Expand ') + node.name
"
[attr.data-testid]="'folder-button-' + node.name"
[attr.data-expanded]="node.isExpanded ? 'true' : 'false'"
>
<mat-icon class="text-blue-900">
@if (node.isExpanded) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export const Files: Story = {
name: 'workspace',
type: 'directory',
isNew: false,
isExpanded: true,
children: [
{
path: '/workspace/file1',
Expand All @@ -62,6 +63,7 @@ export const Files: Story = {
path: '/workspace/directory1',
name: 'directory1',
type: 'directory',
isExpanded: true,
children: [
{
path: '/workspace/directory1/file1',
Expand Down Expand Up @@ -95,10 +97,11 @@ export const Files: Story = {
},
play: async ({ canvasElement }) => {
const canvas = within(canvasElement);
let folderButtons = canvas.getAllByTestId('folder-button');
await userEvent.click(folderButtons[0]);
folderButtons = canvas.getAllByTestId('folder-button');
await userEvent.click(folderButtons[1]);
const folderButton = canvas.getByTestId('folder-button-directory2');

// Needed to trigger Angular change detection
await userEvent.click(folderButton);
await userEvent.click(folderButton);
},
};

Expand All @@ -110,7 +113,7 @@ export const UploadNewFile: Story = {
path: '/workspace',
name: 'workspace',
type: 'directory',
isNew: false,
isExpanded: true,
children: [
{
path: '/workspace/file1',
Expand All @@ -136,11 +139,6 @@ export const UploadNewFile: Story = {
},
]),
},
play: async ({ canvasElement }) => {
const canvas = within(canvasElement);
const folderButton = canvas.getByTestId('folder-button');
await userEvent.click(folderButton);
},
};

export const UploadInProgress: Story = {
Expand Down

0 comments on commit e1d17e8

Please sign in to comment.