Skip to content

Commit

Permalink
TEST: Delete a reference (see Hypertopic#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
LIUC2H5OH committed May 29, 2023
1 parent 81ba62b commit 9ae45cf
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
11 changes: 11 additions & 0 deletions features/delete_reference.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#language: fr

Fonctionnalité: Supprimer les références existantes

Scénario: Supprimer la référence à droite

Soit "Les fées : Conte" le document principal
Et une session active avec mon compte
Quand je vais supprimer les références existantes
Alors La référence n'existe pas dans le document principal

4 changes: 4 additions & 0 deletions features/step_definitions/event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,7 @@
find('textarea').fill_in with: metadata
leave_textarea
end

Quand("je vais supprimer les références existantes") do
click_on_icon('delete_reference')
end
5 changes: 5 additions & 0 deletions features/step_definitions/outcome.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,8 @@
expect(page).to have_content title
end
end

Alors("La référence n'existe pas dans le document principal") do
parent_div = all(".gy-4").last
expect(parent_div).not_to have_selector("div.col-md-12")
end
2 changes: 1 addition & 1 deletion frontend/src/DeleteReferenceButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function DeleteReferenceButton({doc, ref_id, setLastUpdate, backend}) {

return (
<Button variant="danger" size="sm" className="delete-button" onClick={handleDelete}>
<FaTimes/>
<FaTimes className="delete_reference"/>
</Button>
);
}
Expand Down

0 comments on commit 9ae45cf

Please sign in to comment.