| 1 |
# vim:fileencoding=utf-8 |
| 2 |
# License: GPL v3 Copyright: 2026, Kovid Goyal <kovid at kovidgoyal.net> |
| 3 |
from __python__ import hash_literals |
| 4 |
|
| 5 |
from elementmaker import E |
| 6 |
|
| 7 |
from book_list.item_list import create_item, create_item_list |
| 8 |
from testing import assert_true, test |
| 9 |
|
| 10 |
|
| 11 |
@test |
| 12 |
def item_list_class_contract(): |
| 13 |
container = E.div() |
| 14 |
create_item_list(container, [create_item( |
| 15 |
'Title', li_class='item-test-class item-test-extra', row_class='row-test-class row-test-extra' |
| 16 |
)]) |
| 17 |
li = container.querySelector('li') |
| 18 |
assert_true(li.classList.contains('item-test-class')) |
| 19 |
assert_true(li.classList.contains('item-test-extra')) |
| 20 |
assert_true(li.firstChild.classList.contains('row-test-class')) |
| 21 |
assert_true(li.firstChild.classList.contains('row-test-extra')) |