Skip to content

Commit 2d0b298

Browse files
IlanPinnasschml
andcommitted
TEST: Attach a new type to a document (see #19).
Co-authored-by: Nasschml <[email protected]>
1 parent 4027135 commit 2d0b298

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

frontend/tests/event.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,16 @@ Quand("je choisis {string} comme type de glose", (pattern) => {
4747
cy.get('.list-group-item').first().click();
4848
});
4949

50+
Quand("je qualifie le document avec un nouveau type de glose", function() {
51+
cy.get('.typeIcon').click();
52+
this.randomType = [...Array(30)].map(() => Math.random().toString(36)[2]).join('');
53+
cy.get('.inputField.form-control').type(this.randomType);
54+
cy.get('.addButton').click();
55+
cy.get('.typeIcon').click();
56+
cy.get('#searchType').type(this.randomType);
57+
cy.get('.list-group-item').first().click();
58+
});
59+
5060
Quand("je survole le texte :", (text) => {
5161
cy.contains('p[title="Highlight in document"]', text.trim())
5262
.trigger('mouseover');

frontend/tests/outcome.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ Alors("la glose n'a pas de type", () => {
8686
cy.get('.typeSelected').should('not.exist');
8787
});
8888

89+
Alors("le nouveau type est le type de la glose", function() {
90+
cy.contains('.typeSelected', this.randomType);
91+
});
92+
8993
Alors("le texte du document principal est en surbrillance :", (text) => {
9094
cy.contains('mark', text.trim()).should('exist');
9195
});

0 commit comments

Comments
 (0)