add text info corresponding to color
gitea/chrono/pipeline/head This commit looks good Details

This commit is contained in:
Valentin Deniaud 2024-03-13 11:23:50 +01:00
parent 337f0a682f
commit 0a25fc4d9a
2 changed files with 10 additions and 1 deletions

View File

@ -37,7 +37,13 @@
<td class="registrant--day-cell">
{% if booking %}
<span class="booking {{ booking.check_css_class }}">
<!-- Il faut retourner une info textuelle ici et via title attribut -->
{% if booking.check_css_class == 'present' %}
{% trans "Present" %}
{% elif booking.check_css_class == 'absent' %}
{% trans "Absent" %}
{% else %}
{% trans "Not checked" %}
{% endif %}
</span>
{% endif %}
</td>

View File

@ -1153,6 +1153,7 @@ def test_manager_partial_bookings_month_view(app, admin_user, freezer):
assert len(resp.pyquery(user_absent_row)('td')) == 31
assert len(resp.pyquery(user_absent_row)('td span')) == 1
assert len(resp.pyquery(user_absent_row)('td span.booking.absent')) == 1
assert resp.pyquery(user_absent_row)('td span.booking.absent').text() == 'Absent'
subscription_not_booked_row = resp.pyquery('tbody tr')[1]
assert len(resp.pyquery(subscription_not_booked_row)('td')) == 31
@ -1161,11 +1162,13 @@ def test_manager_partial_bookings_month_view(app, admin_user, freezer):
user_not_checked_row = resp.pyquery('tbody tr')[2]
assert len(resp.pyquery(user_not_checked_row)('td')) == 31
assert len(resp.pyquery(user_not_checked_row)('td span.booking')) == 2
assert resp.pyquery(user_not_checked_row)('td span.booking').text() == 'Not checked Not checked'
user_present_row = resp.pyquery('tbody tr')[3]
assert len(resp.pyquery(user_present_row)('td')) == 31
assert len(resp.pyquery(user_present_row)('td span')) == 1
assert len(resp.pyquery(user_present_row)('td span.booking.present')) == 1
assert resp.pyquery(user_present_row)('td span.booking.present').text() == 'Present'
user_present_mixed_row = resp.pyquery('tbody tr')[4]
assert len(resp.pyquery(user_present_mixed_row)('td')) == 31