From 3c701b0b7c68e6e4e0c2c921b3fae02b3c241106 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Corentin=20S=C3=A9chet?= Date: Fri, 28 Oct 2022 16:55:43 +0200 Subject: [PATCH] misc: show form description in links list even if initially hidden --- .../public/templates/combo/link-list-cell.html | 6 +++++- tests/wcs/test_all.py | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/combo/public/templates/combo/link-list-cell.html b/combo/public/templates/combo/link-list-cell.html index 72bbcae1..23288a4b 100644 --- a/combo/public/templates/combo/link-list-cell.html +++ b/combo/public/templates/combo/link-list-cell.html @@ -25,7 +25,11 @@ {% if more_links %} diff --git a/tests/wcs/test_all.py b/tests/wcs/test_all.py index 65e420ea..16e6aa6f 100644 --- a/tests/wcs/test_all.py +++ b/tests/wcs/test_all.py @@ -1876,6 +1876,24 @@ def test_list_of_links_with_form_render(app): resp = app.get('/test_list_of_links_with_form_render/') assert PyQuery(resp.text).find('.links-list li').attr('class') == 'keyword-bar' + link.cached_json = {'description': 'en outre, on est des loutres'} + link.save() + resp = app.get('/test_list_of_links_with_form_render/') + assert PyQuery(resp.text).find('.links-list li .description').text() == 'en outre, on est des loutres' + + WcsFormCell.objects.create( + page=page, + placeholder=cell.link_placeholder, + cached_title='Another title', + cached_url='http://example2.com/', + order=1, + cached_json={'description': 'ça poutre'}, + ) + cell.limit = 1 + cell.save() + resp = app.get('/test_list_of_links_with_form_render/') + assert PyQuery(resp.text).find('.links-list ul.more-items li .description').text() == 'ça poutre' + def test_view_page_with_wcs_cells_num_queries(app, admin_user): page = Page.objects.create(title='bar', slug='index', order=1) -- 2.35.1