Add device_type field, mobile-friendly improvements, and device filtering
- Device model: add device_type column (String 50, nullable) - Device add/edit: type select with presets + custom entry - Device detail: show type in info card; new Edit Device form - Device list: Type column + client-side filter bar (type + text search) - Mobile: card-style responsive tables on dashboard and device list, form-grid-2col collapse, larger tap targets, stacked form-actions, column picker viewport fix, filter bar full-width controls - Assign page: larger radio touch targets (min-height 44px) - 3 new acceptance tests for device_type (45 total)
This commit is contained in:
@@ -456,6 +456,30 @@ def test_delete_device_removed(seeded_client):
|
||||
# Full round-trip
|
||||
# ------------------------------------------------------------------ #
|
||||
|
||||
def test_add_device_with_type(client):
|
||||
resp = client.post("/device/add",
|
||||
data={"name": "TV Remote", "battery_slots": "2", "device_type": "Remote Control"},
|
||||
follow_redirects=True)
|
||||
assert resp.status_code == 200
|
||||
assert b"TV Remote" in resp.data
|
||||
|
||||
|
||||
def test_device_detail_shows_type(client):
|
||||
client.post("/device/add", data={"name": "Torch", "battery_slots": "1", "device_type": "Flashlight"})
|
||||
resp = client.get("/device/1")
|
||||
assert resp.status_code == 200
|
||||
assert b"Flashlight" in resp.data
|
||||
|
||||
|
||||
def test_edit_device_type(client):
|
||||
client.post("/device/add", data={"name": "Torch", "battery_slots": "1"})
|
||||
resp = client.post("/device/1/edit",
|
||||
data={"name": "Torch", "battery_slots": "1", "device_type": "Flashlight"},
|
||||
follow_redirects=True)
|
||||
assert resp.status_code == 200
|
||||
assert b"Flashlight" in resp.data
|
||||
|
||||
|
||||
def test_add_install_delete_battery(client):
|
||||
client.post("/device/add", data={"name": "Gadget", "battery_slots": "1"})
|
||||
client.post("/battery/add", data={"brand": "AcmeBrand", "count": "1"})
|
||||
|
||||
Reference in New Issue
Block a user