refactor: prefix component ID with c (#1127)

This commit is contained in:
Juro Oravec 2025-04-14 12:01:16 +02:00 committed by GitHub
parent fc026cbd99
commit c650e7f3a5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
29 changed files with 786 additions and 746 deletions

View file

@ -512,7 +512,7 @@ class TestDependencyRendering:
template = Template(template_str)
rendered = create_and_process_template_response(template)
assertHTMLEqual(rendered, "Variable: <strong data-djc-id-a1bc3f>foo</strong>")
assertHTMLEqual(rendered, "Variable: <strong data-djc-id-ca1bc3f>foo</strong>")
def test_adds_component_id_html_attr_single_multiroot(self):
class SimpleMultiroot(SimpleComponent):
@ -534,9 +534,9 @@ class TestDependencyRendering:
assertHTMLEqual(
rendered,
"""
Variable: <strong data-djc-id-a1bc3f>foo</strong>
Variable2: <div data-djc-id-a1bc3f>foo</div>
Variable3: <span data-djc-id-a1bc3f>foo</span>
Variable: <strong data-djc-id-ca1bc3f>foo</strong>
Variable2: <div data-djc-id-ca1bc3f>foo</div>
Variable3: <span data-djc-id-ca1bc3f>foo</span>
""",
)
@ -570,10 +570,10 @@ class TestDependencyRendering:
assertHTMLEqual(
rendered,
"""
Variable: <strong data-djc-id-a1bc3f data-djc-id-a1bc41>foo</strong>
Variable2: <div data-djc-id-a1bc3f data-djc-id-a1bc41>foo</div>
Variable3: <span data-djc-id-a1bc3f data-djc-id-a1bc41>foo</span>
<div data-djc-id-a1bc3f>Another</div>
Variable: <strong data-djc-id-ca1bc3f data-djc-id-ca1bc41>foo</strong>
Variable2: <div data-djc-id-ca1bc3f data-djc-id-ca1bc41>foo</div>
Variable3: <span data-djc-id-ca1bc3f data-djc-id-ca1bc41>foo</span>
<div data-djc-id-ca1bc3f>Another</div>
""",
)
@ -613,19 +613,19 @@ class TestDependencyRendering:
assertHTMLEqual(
rendered,
"""
Variable: <strong data-djc-id-a1bc3f data-djc-id-a1bc41>foo</strong>
Variable2: <div data-djc-id-a1bc3f data-djc-id-a1bc41>foo</div>
Variable3: <span data-djc-id-a1bc3f data-djc-id-a1bc41>foo</span>
<div data-djc-id-a1bc3f>Another</div>
Variable: <strong data-djc-id-ca1bc3f data-djc-id-ca1bc41>foo</strong>
Variable2: <div data-djc-id-ca1bc3f data-djc-id-ca1bc41>foo</div>
Variable3: <span data-djc-id-ca1bc3f data-djc-id-ca1bc41>foo</span>
<div data-djc-id-ca1bc3f>Another</div>
Variable: <strong data-djc-id-a1bc42 data-djc-id-a1bc43>foo</strong>
Variable2: <div data-djc-id-a1bc42 data-djc-id-a1bc43>foo</div>
Variable3: <span data-djc-id-a1bc42 data-djc-id-a1bc43>foo</span>
<div data-djc-id-a1bc42>Another</div>
Variable: <strong data-djc-id-ca1bc42 data-djc-id-ca1bc43>foo</strong>
Variable2: <div data-djc-id-ca1bc42 data-djc-id-ca1bc43>foo</div>
Variable3: <span data-djc-id-ca1bc42 data-djc-id-ca1bc43>foo</span>
<div data-djc-id-ca1bc42>Another</div>
Variable: <strong data-djc-id-a1bc44 data-djc-id-a1bc45>foo</strong>
Variable2: <div data-djc-id-a1bc44 data-djc-id-a1bc45>foo</div>
Variable3: <span data-djc-id-a1bc44 data-djc-id-a1bc45>foo</span>
<div data-djc-id-a1bc44>Another</div>
Variable: <strong data-djc-id-ca1bc44 data-djc-id-ca1bc45>foo</strong>
Variable2: <div data-djc-id-ca1bc44 data-djc-id-ca1bc45>foo</div>
Variable3: <span data-djc-id-ca1bc44 data-djc-id-ca1bc45>foo</span>
<div data-djc-id-ca1bc44>Another</div>
""",
)