]> littlesong.place Git - littlesongplace.git/commitdiff
Add profile colors to bio test
authorChris Fulljames <christianfulljames@gmail.com>
Sat, 8 Feb 2025 12:29:56 +0000 (07:29 -0500)
committerChris Fulljames <christianfulljames@gmail.com>
Sat, 8 Feb 2025 12:29:56 +0000 (07:29 -0500)
templates/profile.html
test/test_offline.py

index 1b8144773937160a67f31852c6e3a6f3f74d9e3b..b27278e9266e61a5bcd7b06824d6d100731ae1be 100644 (file)
@@ -11,9 +11,9 @@
     // Apply user colors
     document.addEventListener("DOMContentLoaded", (event) => {
         var rootStyle = document.documentElement.style;
-        {% if user_bgcolor %} rootStyle.setProperty('--yellow', "{{ user_bgcolor }}"); {% endif %}
-        {% if user_fgcolor %} rootStyle.setProperty('--black', "{{ user_fgcolor }}"); {% endif %}
-        {% if user_accolor %} rootStyle.setProperty('--purple', "{{ user_accolor }}"); {% endif %}
+        {% if user_bgcolor %} rootStyle.setProperty("--yellow", "{{ user_bgcolor }}"); {% endif %}
+        {% if user_fgcolor %} rootStyle.setProperty("--black", "{{ user_fgcolor }}"); {% endif %}
+        {% if user_accolor %} rootStyle.setProperty("--purple", "{{ user_accolor }}"); {% endif %}
     });
 </script>
 
index b8775d66b42fae9576d06384ff5886a7dec2ef52..2ff9a38cadfca3bad4bf1e936d134c0be71d014c 100644 (file)
@@ -169,15 +169,21 @@ def test_update_bio(client):
         "bio": "this is the bio",
         "pfp": (b"", "", "aplication/octet-stream"),
         "fgcolor": "#000000",
-        "bgcolor": "#000000",
-        "accolor": "#000000",
+        "bgcolor": "#FFFF00",
+        "accolor": "#FF00FF",
     })
     assert response.status_code == 302
     assert response.headers["Location"] == "/users/user"
 
+    # Check bio updated
     response = client.get("/users/user")
     assert b'<div class="profile-bio" id="profile-bio">this is the bio</div>' in response.data
 
+    # Check user colors applied
+    assert b'"--yellow", "#FFFF00"' in response.data
+    assert b'"--black", "#000000"' in response.data
+    assert b'"--purple", "#FF00FF"' in response.data
+
 def test_upload_pfp(client):
     _create_user(client, "user", "password", login=True)
     response = client.post("/edit-profile", data={