-
Notifications
You must be signed in to change notification settings - Fork 1
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
Updated interface in Work Edit page to allow users to add and delete files #1042
Conversation
|
||
it "allows users to modify the order of the uploads", js: true do | ||
expect(page).to have_content "Filename" | ||
expect(page).to have_content "Created At" | ||
expect(page).to have_content "Replace Upload" | ||
expect(page).to have_content "Delete Upload" | ||
expect(page).to have_css('.uploads-row[data-upload-key="0"]', count: 1) | ||
expect(page).to have_css('.uploads-row[data-upload-key="1"]', count: 1) | ||
|
||
source = page.find('.uploads-row[data-upload-key="0"]') | ||
target = page.find('.uploads-row[data-upload-key="1"]') | ||
|
||
# This is necessary to interact with the rendered JavaScript <table> rows | ||
page.scroll_to(target) | ||
sleep 1 | ||
|
||
source.drag_to(target) | ||
sleep 1 | ||
|
||
dragged = page.find('.uploads-row[data-upload-key="0"]') | ||
expect(dragged[:id]).to eq(source[:id]) | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no idea what this test was attempting to test...but we do not allow the user to re-order the display of files so I removed it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hectorcorrea I deployed this to staging and got errors when trying to delete files.
@carolyncole thank you so much tip, the spaces where indeed the problem. I've updated the code to use a safe value for the id of the HTML elements (based on the full path of the name) that prevents issue with any non-alphanumeric characters in the name. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hectorcorrea now works for me. Thanks for updating it!
There are three major changes on this PR:
Closes #1021
Closes #1010
Notice that I left a few TODOs in the code that point to an (existing) issue that needs to be addressed separately (#1041)