Skip to content

Commit

Permalink
Prepare tests for multiple links in the footer
Browse files Browse the repository at this point in the history
Including a link showing the owner/group of the file/directory would
make our test fail as the selector becomes ambiguous.
  • Loading branch information
jelly authored and martinpitt committed Jan 10, 2025
1 parent d41be5c commit ed23777
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/files-footer-detail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ export const FilesFooterDetail = ({
variant="link"
isInline
component="pre"
id="files-footer-permissions"
>
{permissionShortStr(selectedFile.mode)}
</Button>
Expand Down
8 changes: 4 additions & 4 deletions test/check-application
Original file line number Diff line number Diff line change
Expand Up @@ -330,12 +330,12 @@ class TestFiles(testlib.MachineCase):
# Change permissions of cwd and see that files-footer-info is updated
b.go("/files#/?path=/home/admin/newdir")
self.assert_last_breadcrumb("newdir")
b.wait_in_text(".files-footer-info .pf-m-link", "rwx r-x r-x")
b.wait_in_text("#files-footer-permissions", "rwx r-x r-x")
m.execute("chmod 700 /home/admin/newdir")
b.wait_in_text(".files-footer-info .pf-m-link", "rwx --- ---")
b.wait_in_text("#files-footer-permissions", "rwx --- ---")

# Also check popover
b.click(".files-footer-info .pf-m-link")
b.click("#files-footer-permissions")
b.wait_in_text(".pf-v5-c-popover dl div:nth-child(1) > dd", "read, write, and execute")
b.wait_in_text(".pf-v5-c-popover dl div:nth-child(2) > dd", "none")
b.wait_in_text(".pf-v5-c-popover dl div:nth-child(3) > dd", "none")
Expand Down Expand Up @@ -379,7 +379,7 @@ class TestFiles(testlib.MachineCase):
# Selecting one file shows its info in the footer
b.click("[data-item='newdir']")
b.wait_in_text(".files-footer-info", "newdir")
b.wait_in_text(".files-footer-info .pf-m-link", "rwx --- ---")
b.wait_in_text("#files-footer-permissions", "rwx --- ---")

# Select multiple files
m.execute("touch /home/admin/newfile.txt")
Expand Down

0 comments on commit ed23777

Please sign in to comment.