Commit Graph

39 Commits

Author SHA1 Message Date
Javi Martín
f15991dd3e Simplify tests replying to a comment
We were using the `reply_to` method in some places, but not in others.
2025-04-01 14:53:26 +02:00
Javi Martín
11ef917802 Use a button to delete comments
As mentioned in commit 5311daadf, there are several reasons to use
buttons in these situations. And, as mentioned in the previous commits,
using buttons instead of links for actions requiring confirmation will
help us test for accessibility issues.
2024-11-08 13:01:01 +01:00
taitus
793eaf4429 Remove unnecessary specs
The test "display administrator id on public views" is not correct. The valuation comments
are not display never on public views. If we reload this admin page we can see that the
description is render instead of administrator_id as we can see at the upper test:

```
scenario "display administrator description on admin views"
```

The deleted test was passed because there is an error at the moment to render the comments.
As we can see in the file ´app/views/comments/create.js.erb:10´ we try render comment
without valuation value:

```
App.Comments.add_comment(parent_id, "<li><%= j(render @comment) %></li>");
```
That it is necessary to render correctly the description or the id.

By other hand the test "public users not see admin description"  is already being checked
 in the 'system/comments_specs'. However, we are going to add a new expectation to
make sure that the admin description does not appear on the public pages.
2024-03-25 07:59:42 +01:00
taitus
3f1561e408 Unify flaggable specs 2024-03-25 07:59:42 +01:00
taitus
f328d53f41 Unify submit button comments specs 2024-03-25 07:59:42 +01:00
taitus
e3ce8a85fa Unify show comments specs 2024-03-25 07:59:42 +01:00
taitus
886aee72fc Unify reply to reply comments specs 2024-03-25 07:59:42 +01:00
taitus
8da4c60c2a Unify hide comments specs 2024-03-25 07:59:42 +01:00
taitus
8ba16c2330 Unify collapse comments specs 2024-03-25 07:59:42 +01:00
taitus
093ad07a14 Unify voting comments allow undoing votes specs 2024-03-25 07:59:42 +01:00
taitus
992a8182ff Unify voting comments update specs 2024-03-25 07:59:42 +01:00
taitus
35bc03f640 Unify voting comments create specs 2024-03-25 07:59:42 +01:00
taitus
dbd419e75d Unify voting comments show specs 2024-03-25 07:59:42 +01:00
taitus
57805747a2 Simplify administrators comments tests 2024-03-25 07:59:42 +01:00
taitus
79d00e7b92 Unify can not comment as a moderator specs 2024-03-25 07:59:42 +01:00
taitus
ac740f3657 Unify reply as an administrator
Note that the click_link "Reply" is now inside a "within".

This is due to the case of "legislation_annotation" before in the original test
no comment was created as it simply took the one created by default when creating
a "legislation_annotation".

```
  annotation = create(:legislation_annotation, author: citizen)
  comment = annotation.comments.first
```

Now to try to unify this test, we always create a comment, and in this case as we
also created the "legislation_annotation" we have 2 comments, so it is necessary
to add the "click_link" inside the "within".
2024-03-25 07:59:42 +01:00
taitus
f9349a4b0d Unify comment as administrator specs 2024-03-25 07:59:42 +01:00
taitus
8a2e0c8e1f Simplify moderator comments tests 2024-03-25 07:59:42 +01:00
taitus
adae022f77 Unify can not comment as an administrator specs 2024-03-25 07:59:42 +01:00
taitus
a949a046ab Unify reply as a moderator specs
Note that the click_link "Reply" is now inside a "within".

This is due to the case of "legislation_annotation" before in the original test
no comment was created as it simply took the one created by default when creating
a "legislation_annotation".

```
  annotation = create(:legislation_annotation, author: citizen)
  comment = annotation.comments.first
```

Now to try to unify this test, we always create a comment, and in this case as we
also created the "legislation_annotation" we have 2 comments, so it is necessary
to add the "click_link" inside the "within".
2024-03-25 07:59:42 +01:00
taitus
1a17ab4ac1 Unify comment as a moderator specs 2024-03-25 07:59:42 +01:00
taitus
154fb19b87 Unify erasing a comment's author comments specs 2024-03-25 07:59:42 +01:00
taitus
df4668004c Unify N replies comments specs 2024-03-25 07:59:42 +01:00
taitus
f0fa004f85 Unify errors on reply comments specs
Note that the click_link "Reply" is now inside a "within".

This is due to the case of "legislation_annotation" before in the original test
no comment was created as it simply took the one created by default when creating
a "legislation_annotation".

```
comment = annotation.comments.first
```

Now to try to unify this test, we always create a comment, and in this case as we
also created the "legislation_annotation" we have 2 comments, so it is necessary
to add the "click_link" inside the "within".
2024-03-25 07:59:42 +01:00
taitus
f4c3e740e6 Unify reply show parent comments specs 2024-03-25 07:59:42 +01:00
taitus
d4f3680dcc Unify reply update parent comments specs 2024-03-25 07:59:42 +01:00
taitus
d3f4c7f99e Unify reply comments specs
Note that the click_link "Reply" is now inside a "within".

This is due to the case of "legislation_annotation" before in the original test
no comment was created as it simply took the one created by default when creating
a "legislation_annotation".

```
  annotation = create(:legislation_annotation, author: citizen)
  comment = annotation.comments.first
```

Now to try to unify this test, we always create a comment, and in this case as we
also created the "legislation_annotation" we have 2 comments, so it is necessary
to add the "click_link" inside the "within".
2024-03-25 07:59:42 +01:00
taitus
ed5ba0592c Unify create comments specs 2024-03-25 07:59:42 +01:00
taitus
d24c2859c4 Unify paginated comments specs 2024-03-25 07:59:42 +01:00
taitus
7006564c31 Unify sanitizes comment spec 2024-03-25 07:59:42 +01:00
taitus
2f01d66557 Unify turns links specs 2024-03-25 07:59:42 +01:00
taitus
b979c17a4b Unify Creation date specs 2024-03-25 07:59:42 +01:00
taitus
98aea85eaa Unify comment order specs 2024-03-25 07:59:42 +01:00
taitus
daab57a21e Unify collapsable comments specs 2024-03-25 07:59:42 +01:00
taitus
0c58e7e3b4 Unify link to comment show specs
Note that, in all cases except in :legislation_annotation, the behavior for
click_link is now slightly different.

Previously, the click_link outsite of within block meant that we made sure there
was only one link with that text in the whole page. Now, in order to unify this
spec we change the behaviour.
2024-03-25 07:59:42 +01:00
taitus
f2e4eec748 Unify show comments specs 2024-03-25 07:59:42 +01:00
taitus
ab79d1e30e Unify index comments specs 2024-03-25 07:59:42 +01:00
taitus
a5e4fb13b4 Unify errors on create comments 2024-03-25 07:59:42 +01:00
taitus
0f2f79ba99 Unify not logged user comments specs
Since commit de1bfd44 'Write a comment' text is deleted.
We are changing this text for the current text 'Leave your comment'
or 'Leave your answer'
2024-03-25 07:59:42 +01:00