Skip to content

Commit 1b543f0

Browse files
fsecada01claude
andcommitted
test: E2E Playwright golden rule tests — js_on and js_off for interactive components
- Add tests/e2e/conftest.py: session-scoped FastAPI (uvicorn thread) and Django (subprocess) server fixtures, plus js_on/js_off parameterized page fixtures - Add tests/e2e/test_bulma_jinja.py: 6 tests covering modal open/close, notification dismiss, panel expand, navbar burger, form-field render, and no-JS accessibility (2x each via param = 12 total, 1 skipped on js_on mode) - Add tests/e2e/test_bulma_cotton.py: 3 tests covering form-field, modal, and card rendering (2x each via param = 6 total) - Add tests/e2e/_django_e2e_server.py + _e2e_django_settings.py: isolated subprocess server with django_cotton, COTTON_DIR=cotton/bulma, and COTTON_SNAKE_CASED_NAMES=False so cotton renders fully without polluting the main pytest process Django settings (prevents unit test regressions) - Migrate all 14 cotton/bulma templates from <c-props> to <c-vars> to be compatible with django-cotton 2.x (c-props compiled to component lookup in 2.x) - Mount /static/cf_ui static files in the jinja integration app so Alpine.js initializes for js_on E2E tests Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent a258737 commit 1b543f0

20 files changed

Lines changed: 288 additions & 14 deletions

src/cf_ui/templates/cotton/bulma/cf/breadcrumb.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<c-props items="[]" class="" />
1+
<c-vars items="[]" class="" />
22
<nav class="breadcrumb {{ class }}" aria-label="breadcrumbs">
33
<ul>
44
{% for item in items %}

src/cf_ui/templates/cotton/bulma/cf/card.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<c-props header="" footer="" class="" />
1+
<c-vars header="" footer="" class="" />
22
<div class="card {{ class }}">
33
{% if header %}
44
<header class="card-header">

src/cf_ui/templates/cotton/bulma/cf/checkbox-group.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<c-props name label error="" choices="[]" selected="[]" class="" />
1+
<c-vars name label error="" choices="[]" selected="[]" class="" />
22
<div class="field {{ class }}">
33
<label class="label">{{ label }}</label>
44
<div class="control">

src/cf_ui/templates/cotton/bulma/cf/form-field.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<c-props name label value="" error="" type="text" required="false" class="" />
1+
<c-vars name label value="" error="" type="text" required="false" class="" />
22
<div class="field {{ class }}">
33
<label class="label" for="{{ name }}">{{ label }}</label>
44
<div class="control">

src/cf_ui/templates/cotton/bulma/cf/modal.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<c-props id="modal" header="" footer="" class="" />
1+
<c-vars id="modal" header="" footer="" class="" />
22
<div id="{{ id }}"
33
class="modal {{ class }}"
44
x-data="cfModal"

src/cf_ui/templates/cotton/bulma/cf/navbar.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<c-props brand="" start="" end="" class="" />
1+
<c-vars brand="" start="" end="" class="" />
22
<nav class="navbar {{ class }}" role="navigation" aria-label="main navigation"
33
x-data="cfNavbar">
44
<div class="navbar-brand">

src/cf_ui/templates/cotton/bulma/cf/notification.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<c-props message type="info" dismissible="true" class="" />
1+
<c-vars message type="info" dismissible="true" class="" />
22
<div class="notification is-{{ type }} {{ class }}"
33
x-data="{ visible: true }"
44
x-show="visible">

src/cf_ui/templates/cotton/bulma/cf/pagination.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<c-props page="1" total_pages="1" hx_target="" hx_url="" class="" />
1+
<c-vars page="1" total_pages="1" hx_target="" hx_url="" class="" />
22
{% load cf_ui %}
33
<nav class="pagination is-centered {{ class }}" role="navigation" aria-label="pagination">
44
{% if page|add:"0" > 1 %}

src/cf_ui/templates/cotton/bulma/cf/panel.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<c-props title class="" />
1+
<c-vars title class="" />
22
<div class="card {{ class }}" x-data="cfPanel">
33
<header class="card-header" style="cursor:pointer" @click="toggle()">
44
<p class="card-header-title">{{ title }}</p>

src/cf_ui/templates/cotton/bulma/cf/progress.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<c-props value="0" max="100" type="primary" label="" class="" />
1+
<c-vars value="0" max="100" type="primary" label="" class="" />
22
<div class="{{ class }}">
33
{% if label %}<p class="has-text-centered mb-1">{{ label }}</p>{% endif %}
44
<progress class="progress is-{{ type }}"

0 commit comments

Comments
 (0)