Skip to content

Commit

Permalink
verify reference delete, modified test for it
Browse files Browse the repository at this point in the history
  • Loading branch information
doomwall committed Dec 11, 2024
1 parent 6d719f0 commit 23c0e7e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/story_tests/delete_reference.robot
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Deleting a Reference Should Remove It From The List
${normal}= Run Keyword And Return Status Element Should Be Visible id=view_normal_format
Run Keyword If ${normal} Click Normal Button If Shown
Click Button Delete
Alert Should Be Present
Go To References List Page
Page Should Not Contain Kernighan, Brian and Ritchie, Dennis

Expand Down
6 changes: 4 additions & 2 deletions src/templates/reference_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ <h2 style="padding-top: 30px;">References</h2>
<button type="submit" class="btn btn-primary">Edit</button>
</form>
<form action="/delete_reference/{{ reference[0] }}" method="post">
<button type="submit" class="btn btn-danger">Delete</button>
<button type="submit" class="btn btn-danger" onclick="confirmDelete(event, this.form)">Delete</button>
</form>
</div>
</li>
Expand Down Expand Up @@ -148,7 +148,9 @@ <h2 style="padding-top: 30px;">References</h2>
</div>

<script>
function confirmDelete(form) {
function confirmDelete(event, form) {
event.preventDefault();

if (confirm("Are you sure you want to delete this reference?")) {
form.submit();
}
Expand Down

0 comments on commit 23c0e7e

Please sign in to comment.