\ No newline at end of file
diff --git a/engine/fixtures/TestRenderError_client_error_404_not_found.html b/engine/fixtures/TestRenderError_client_error_404_not_found.html
new file mode 100644
index 0000000..b6f2261
--- /dev/null
+++ b/engine/fixtures/TestRenderError_client_error_404_not_found.html
@@ -0,0 +1 @@
+Conway Makerspace System
Bad Request
Page not found
\ No newline at end of file
diff --git a/engine/fixtures/TestRenderError_edge_case_499_edge_case_499.html b/engine/fixtures/TestRenderError_edge_case_499_edge_case_499.html
new file mode 100644
index 0000000..ca58f59
--- /dev/null
+++ b/engine/fixtures/TestRenderError_edge_case_499_edge_case_499.html
@@ -0,0 +1 @@
+Conway Makerspace System
Bad Request
Client closed request
\ No newline at end of file
diff --git a/engine/fixtures/TestRenderError_server_error_500_server_error.html b/engine/fixtures/TestRenderError_server_error_500_server_error.html
new file mode 100644
index 0000000..373945a
--- /dev/null
+++ b/engine/fixtures/TestRenderError_server_error_500_server_error.html
@@ -0,0 +1 @@
+Conway Makerspace System
Uh oh
Internal server error
\ No newline at end of file
diff --git a/engine/fixtures/TestRenderError_server_error_502_bad_gateway.html b/engine/fixtures/TestRenderError_server_error_502_bad_gateway.html
new file mode 100644
index 0000000..3c57f18
--- /dev/null
+++ b/engine/fixtures/TestRenderError_server_error_502_bad_gateway.html
@@ -0,0 +1 @@
+Conway Makerspace System
\ No newline at end of file
diff --git a/modules/admin/fixtures/TestRenderAdminListElements_paginated_list_first_page_paginated_first.html b/modules/admin/fixtures/TestRenderAdminListElements_paginated_list_first_page_paginated_first.html
new file mode 100644
index 0000000..a2b4656
--- /dev/null
+++ b/modules/admin/fixtures/TestRenderAdminListElements_paginated_list_first_page_paginated_first.html
@@ -0,0 +1,9 @@
+
ID
Email
Status
1
user1@example.com
Ready
\ No newline at end of file
diff --git a/modules/admin/fixtures/TestRenderAdminListElements_paginated_list_last_page_paginated_last.html b/modules/admin/fixtures/TestRenderAdminListElements_paginated_list_last_page_paginated_last.html
new file mode 100644
index 0000000..d4cbf95
--- /dev/null
+++ b/modules/admin/fixtures/TestRenderAdminListElements_paginated_list_last_page_paginated_last.html
@@ -0,0 +1,9 @@
+
ID
Email
Status
25
user25@example.com
Inactive
\ No newline at end of file
diff --git a/modules/admin/fixtures/TestRenderAdminListElements_paginated_list_middle_page_paginated_middle.html b/modules/admin/fixtures/TestRenderAdminListElements_paginated_list_middle_page_paginated_middle.html
new file mode 100644
index 0000000..12e629b
--- /dev/null
+++ b/modules/admin/fixtures/TestRenderAdminListElements_paginated_list_middle_page_paginated_middle.html
@@ -0,0 +1,9 @@
+
ID
Email
Status
11
user11@example.com
Active
\ No newline at end of file
diff --git a/modules/admin/fixtures/TestRenderAdminListElements_simple_list_simple.html b/modules/admin/fixtures/TestRenderAdminListElements_simple_list_simple.html
new file mode 100644
index 0000000..b8868df
--- /dev/null
+++ b/modules/admin/fixtures/TestRenderAdminListElements_simple_list_simple.html
@@ -0,0 +1,9 @@
+
\ No newline at end of file
diff --git a/modules/admin/fixtures/TestRenderAdminList_complex_search_url_complex_search.html b/modules/admin/fixtures/TestRenderAdminList_complex_search_url_complex_search.html
new file mode 100644
index 0000000..8195801
--- /dev/null
+++ b/modules/admin/fixtures/TestRenderAdminList_complex_search_url_complex_search.html
@@ -0,0 +1 @@
+Conway Makerspace System
Transaction Reports
\ No newline at end of file
diff --git a/modules/admin/fixtures/TestRenderAdminList_events_list_events.html b/modules/admin/fixtures/TestRenderAdminList_events_list_events.html
new file mode 100644
index 0000000..5c68693
--- /dev/null
+++ b/modules/admin/fixtures/TestRenderAdminList_events_list_events.html
@@ -0,0 +1 @@
+Conway Makerspace System
Events
\ No newline at end of file
diff --git a/modules/admin/fixtures/TestRenderAdminList_members_list_members.html b/modules/admin/fixtures/TestRenderAdminList_members_list_members.html
new file mode 100644
index 0000000..9b70177
--- /dev/null
+++ b/modules/admin/fixtures/TestRenderAdminList_members_list_members.html
@@ -0,0 +1 @@
+Conway Makerspace System
Members
\ No newline at end of file
diff --git a/modules/admin/fixtures/TestRenderAdminList_minimal_list_minimal.html b/modules/admin/fixtures/TestRenderAdminList_minimal_list_minimal.html
new file mode 100644
index 0000000..4881b2b
--- /dev/null
+++ b/modules/admin/fixtures/TestRenderAdminList_minimal_list_minimal.html
@@ -0,0 +1 @@
+Conway Makerspace System
Items
\ No newline at end of file
diff --git a/modules/admin/fixtures/TestRenderListPagination_first_page_multiple_first_multiple.html b/modules/admin/fixtures/TestRenderListPagination_first_page_multiple_first_multiple.html
new file mode 100644
index 0000000..9e2f922
--- /dev/null
+++ b/modules/admin/fixtures/TestRenderListPagination_first_page_multiple_first_multiple.html
@@ -0,0 +1,8 @@
+
\ No newline at end of file
diff --git a/modules/admin/fixtures/TestRenderListPagination_large_pagination_large.html b/modules/admin/fixtures/TestRenderListPagination_large_pagination_large.html
new file mode 100644
index 0000000..e15a6e8
--- /dev/null
+++ b/modules/admin/fixtures/TestRenderListPagination_large_pagination_large.html
@@ -0,0 +1,8 @@
+
\ No newline at end of file
diff --git a/modules/admin/fixtures/TestRenderListPagination_last_page_last.html b/modules/admin/fixtures/TestRenderListPagination_last_page_last.html
new file mode 100644
index 0000000..1f458e5
--- /dev/null
+++ b/modules/admin/fixtures/TestRenderListPagination_last_page_last.html
@@ -0,0 +1,8 @@
+
\ No newline at end of file
diff --git a/modules/admin/fixtures/TestRenderListPagination_middle_page_middle.html b/modules/admin/fixtures/TestRenderListPagination_middle_page_middle.html
new file mode 100644
index 0000000..42d1256
--- /dev/null
+++ b/modules/admin/fixtures/TestRenderListPagination_middle_page_middle.html
@@ -0,0 +1,8 @@
+
\ No newline at end of file
diff --git a/modules/admin/fixtures/TestRenderListPagination_single_page_single.html b/modules/admin/fixtures/TestRenderListPagination_single_page_single.html
new file mode 100644
index 0000000..30610fe
--- /dev/null
+++ b/modules/admin/fixtures/TestRenderListPagination_single_page_single.html
@@ -0,0 +1,8 @@
+
\ No newline at end of file
diff --git a/modules/admin/fixtures/TestRenderSingleMember_all_discounts_educator_discount.html b/modules/admin/fixtures/TestRenderSingleMember_all_discounts_educator_discount.html
new file mode 100644
index 0000000..ef717fb
--- /dev/null
+++ b/modules/admin/fixtures/TestRenderSingleMember_all_discounts_educator_discount.html
@@ -0,0 +1,19 @@
+Conway Makerspace System
\ No newline at end of file
diff --git a/modules/admin/fixtures/TestRenderSingleMember_complete_member_active_complete_active.html b/modules/admin/fixtures/TestRenderSingleMember_complete_member_active_complete_active.html
new file mode 100644
index 0000000..2a6225f
--- /dev/null
+++ b/modules/admin/fixtures/TestRenderSingleMember_complete_member_active_complete_active.html
@@ -0,0 +1,19 @@
+Conway Makerspace System
\ No newline at end of file
diff --git a/modules/admin/fixtures/TestRenderSingleMember_family_discount_family_discount.html b/modules/admin/fixtures/TestRenderSingleMember_family_discount_family_discount.html
new file mode 100644
index 0000000..0b52688
--- /dev/null
+++ b/modules/admin/fixtures/TestRenderSingleMember_family_discount_family_discount.html
@@ -0,0 +1,19 @@
+Conway Makerspace System
\ No newline at end of file
diff --git a/modules/admin/fixtures/TestRenderSingleMember_inactive_member_inactive.html b/modules/admin/fixtures/TestRenderSingleMember_inactive_member_inactive.html
new file mode 100644
index 0000000..9c86376
--- /dev/null
+++ b/modules/admin/fixtures/TestRenderSingleMember_inactive_member_inactive.html
@@ -0,0 +1,19 @@
+Conway Makerspace System
\ No newline at end of file
diff --git a/modules/admin/fixtures/TestRenderSingleMember_many_events_many_events.html b/modules/admin/fixtures/TestRenderSingleMember_many_events_many_events.html
new file mode 100644
index 0000000..b440995
--- /dev/null
+++ b/modules/admin/fixtures/TestRenderSingleMember_many_events_many_events.html
@@ -0,0 +1,19 @@
+Conway Makerspace System
\ No newline at end of file
diff --git a/modules/admin/fixtures/TestRenderSingleMember_minimal_member_minimal.html b/modules/admin/fixtures/TestRenderSingleMember_minimal_member_minimal.html
new file mode 100644
index 0000000..f354340
--- /dev/null
+++ b/modules/admin/fixtures/TestRenderSingleMember_minimal_member_minimal.html
@@ -0,0 +1,19 @@
+Conway Makerspace System
\ No newline at end of file
diff --git a/modules/admin/fixtures/TestRenderSingleMember_non_billable_leadership_leadership_nonbillable.html b/modules/admin/fixtures/TestRenderSingleMember_non_billable_leadership_leadership_nonbillable.html
new file mode 100644
index 0000000..e8f566f
--- /dev/null
+++ b/modules/admin/fixtures/TestRenderSingleMember_non_billable_leadership_leadership_nonbillable.html
@@ -0,0 +1,19 @@
+Conway Makerspace System
\ No newline at end of file
diff --git a/modules/admin/fixtures/TestRenderSingleMember_paypal_member_paypal.html b/modules/admin/fixtures/TestRenderSingleMember_paypal_member_paypal.html
new file mode 100644
index 0000000..7579422
--- /dev/null
+++ b/modules/admin/fixtures/TestRenderSingleMember_paypal_member_paypal.html
@@ -0,0 +1,19 @@
+Conway Makerspace System
\ No newline at end of file
diff --git a/modules/admin/fixtures/TestRenderSingleMember_stripe_empty_status_stripe_empty.html b/modules/admin/fixtures/TestRenderSingleMember_stripe_empty_status_stripe_empty.html
new file mode 100644
index 0000000..55c8761
--- /dev/null
+++ b/modules/admin/fixtures/TestRenderSingleMember_stripe_empty_status_stripe_empty.html
@@ -0,0 +1,19 @@
+Conway Makerspace System
\ No newline at end of file
diff --git a/modules/admin/fixtures/TestRenderSingleMember_stripe_inactive_no_sub_stripe_no_sub.html b/modules/admin/fixtures/TestRenderSingleMember_stripe_inactive_no_sub_stripe_no_sub.html
new file mode 100644
index 0000000..b6642ce
--- /dev/null
+++ b/modules/admin/fixtures/TestRenderSingleMember_stripe_inactive_no_sub_stripe_no_sub.html
@@ -0,0 +1,19 @@
+Conway Makerspace System
\ No newline at end of file
diff --git a/modules/admin/fixtures/TestRenderSingleMember_stripe_unknown_status_stripe_unknown.html b/modules/admin/fixtures/TestRenderSingleMember_stripe_unknown_status_stripe_unknown.html
new file mode 100644
index 0000000..1d5cd62
--- /dev/null
+++ b/modules/admin/fixtures/TestRenderSingleMember_stripe_unknown_status_stripe_unknown.html
@@ -0,0 +1,19 @@
+Conway Makerspace System
Please ignore this message if you did not request a login code from TheLab Makerspace.
\ No newline at end of file
diff --git a/modules/auth/fixtures/TestRenderLoginEmail_complex_callback_complex_callback.html b/modules/auth/fixtures/TestRenderLoginEmail_complex_callback_complex_callback.html
new file mode 100644
index 0000000..2860ded
--- /dev/null
+++ b/modules/auth/fixtures/TestRenderLoginEmail_complex_callback_complex_callback.html
@@ -0,0 +1 @@
+
Please ignore this message if you did not request a login code from TheLab Makerspace.
\ No newline at end of file
diff --git a/modules/auth/fixtures/TestRenderLoginEmail_empty_callback_empty_callback.html b/modules/auth/fixtures/TestRenderLoginEmail_empty_callback_empty_callback.html
new file mode 100644
index 0000000..fb88417
--- /dev/null
+++ b/modules/auth/fixtures/TestRenderLoginEmail_empty_callback_empty_callback.html
@@ -0,0 +1 @@
+
Please ignore this message if you did not request a login code from TheLab Makerspace.
\ No newline at end of file
diff --git a/modules/auth/fixtures/TestRenderLoginEmail_localhost_email_localhost.html b/modules/auth/fixtures/TestRenderLoginEmail_localhost_email_localhost.html
new file mode 100644
index 0000000..44922e3
--- /dev/null
+++ b/modules/auth/fixtures/TestRenderLoginEmail_localhost_email_localhost.html
@@ -0,0 +1 @@
+
Please ignore this message if you did not request a login code from TheLab Makerspace.
\ No newline at end of file
diff --git a/modules/auth/fixtures/TestRenderLoginEmail_root_callback_root_callback.html b/modules/auth/fixtures/TestRenderLoginEmail_root_callback_root_callback.html
new file mode 100644
index 0000000..6570d22
--- /dev/null
+++ b/modules/auth/fixtures/TestRenderLoginEmail_root_callback_root_callback.html
@@ -0,0 +1 @@
+
Please ignore this message if you did not request a login code from TheLab Makerspace.
\ No newline at end of file
diff --git a/modules/auth/fixtures/TestRenderLoginPage_basic_login_basic.html b/modules/auth/fixtures/TestRenderLoginPage_basic_login_basic.html
new file mode 100644
index 0000000..bfc47e4
--- /dev/null
+++ b/modules/auth/fixtures/TestRenderLoginPage_basic_login_basic.html
@@ -0,0 +1 @@
+Conway Makerspace System
Login or Signup
\ No newline at end of file
diff --git a/modules/auth/fixtures/TestRenderLoginPage_complex_callback_complex_callback.html b/modules/auth/fixtures/TestRenderLoginPage_complex_callback_complex_callback.html
new file mode 100644
index 0000000..f553fb1
--- /dev/null
+++ b/modules/auth/fixtures/TestRenderLoginPage_complex_callback_complex_callback.html
@@ -0,0 +1 @@
+Conway Makerspace System
Login or Signup
\ No newline at end of file
diff --git a/modules/auth/fixtures/TestRenderLoginPage_empty_callback_empty_callback.html b/modules/auth/fixtures/TestRenderLoginPage_empty_callback_empty_callback.html
new file mode 100644
index 0000000..879aaa2
--- /dev/null
+++ b/modules/auth/fixtures/TestRenderLoginPage_empty_callback_empty_callback.html
@@ -0,0 +1 @@
+Conway Makerspace System
Login or Signup
\ No newline at end of file
diff --git a/modules/auth/fixtures/TestRenderLoginPage_root_callback_root_callback.html b/modules/auth/fixtures/TestRenderLoginPage_root_callback_root_callback.html
new file mode 100644
index 0000000..69abc7d
--- /dev/null
+++ b/modules/auth/fixtures/TestRenderLoginPage_root_callback_root_callback.html
@@ -0,0 +1 @@
+Conway Makerspace System
Login or Signup
\ No newline at end of file
diff --git a/modules/auth/fixtures/TestRenderLoginPage_with_turnstile_with_turnstile.html b/modules/auth/fixtures/TestRenderLoginPage_with_turnstile_with_turnstile.html
new file mode 100644
index 0000000..e2604fd
--- /dev/null
+++ b/modules/auth/fixtures/TestRenderLoginPage_with_turnstile_with_turnstile.html
@@ -0,0 +1 @@
+Conway Makerspace System
Login or Signup
\ No newline at end of file
diff --git a/modules/auth/fixtures/TestRenderLoginSentPage.html b/modules/auth/fixtures/TestRenderLoginSentPage.html
new file mode 100644
index 0000000..d7477b8
--- /dev/null
+++ b/modules/auth/fixtures/TestRenderLoginSentPage.html
@@ -0,0 +1 @@
+Conway Makerspace System
Email Sent
We sent a login link to the provided email address.
`))
+ return err
+ })
+}
+
+func TestView(t *testing.T) {
+ // Test View() by creating a component that uses it with mock content
+ component := templ.ComponentFunc(func(ctx context.Context, w io.Writer) error {
+ return View().Render(templ.WithChildren(ctx, mockComponent()), w)
+ })
+ snaptest.RenderSnapshotWithName(t, component, "")
+}
+
+func TestDarkmodeView(t *testing.T) {
+ // Test DarkmodeView() by creating a component that uses it with mock content
+ component := templ.ComponentFunc(func(ctx context.Context, w io.Writer) error {
+ return DarkmodeView().Render(templ.WithChildren(ctx, mockComponent()), w)
+ })
+ snaptest.RenderSnapshotWithName(t, component, "")
+}
+
+func TestViewWithTheme(t *testing.T) {
+ tests := []struct {
+ name string
+ theme string
+ fixtureName string
+ }{
+ {
+ name: "empty_theme",
+ theme: "",
+ fixtureName: "_empty_theme",
+ },
+ {
+ name: "dark_theme",
+ theme: "dark",
+ fixtureName: "_dark_theme",
+ },
+ {
+ name: "custom_theme",
+ theme: "custom",
+ fixtureName: "_custom_theme",
+ },
+ }
+
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ component := templ.ComponentFunc(func(ctx context.Context, w io.Writer) error {
+ return view(tt.theme).Render(templ.WithChildren(ctx, mockComponent()), w)
+ })
+ snaptest.RenderSnapshotWithName(t, component, tt.fixtureName)
+ })
+ }
+}
\ No newline at end of file
diff --git a/modules/bootstrap/fixtures/TestDarkmodeView.html b/modules/bootstrap/fixtures/TestDarkmodeView.html
new file mode 100644
index 0000000..ab62d68
--- /dev/null
+++ b/modules/bootstrap/fixtures/TestDarkmodeView.html
@@ -0,0 +1 @@
+Conway Makerspace System
Test Content
This is test content.
\ No newline at end of file
diff --git a/modules/bootstrap/fixtures/TestView.html b/modules/bootstrap/fixtures/TestView.html
new file mode 100644
index 0000000..73a11b5
--- /dev/null
+++ b/modules/bootstrap/fixtures/TestView.html
@@ -0,0 +1 @@
+Conway Makerspace System
Test Content
This is test content.
\ No newline at end of file
diff --git a/modules/bootstrap/fixtures/TestViewWithTheme_custom_theme_custom_theme.html b/modules/bootstrap/fixtures/TestViewWithTheme_custom_theme_custom_theme.html
new file mode 100644
index 0000000..87dd4f5
--- /dev/null
+++ b/modules/bootstrap/fixtures/TestViewWithTheme_custom_theme_custom_theme.html
@@ -0,0 +1 @@
+Conway Makerspace System
Test Content
This is test content.
\ No newline at end of file
diff --git a/modules/bootstrap/fixtures/TestViewWithTheme_dark_theme_dark_theme.html b/modules/bootstrap/fixtures/TestViewWithTheme_dark_theme_dark_theme.html
new file mode 100644
index 0000000..ab62d68
--- /dev/null
+++ b/modules/bootstrap/fixtures/TestViewWithTheme_dark_theme_dark_theme.html
@@ -0,0 +1 @@
+Conway Makerspace System
Test Content
This is test content.
\ No newline at end of file
diff --git a/modules/bootstrap/fixtures/TestViewWithTheme_empty_theme_empty_theme.html b/modules/bootstrap/fixtures/TestViewWithTheme_empty_theme_empty_theme.html
new file mode 100644
index 0000000..73a11b5
--- /dev/null
+++ b/modules/bootstrap/fixtures/TestViewWithTheme_empty_theme_empty_theme.html
@@ -0,0 +1 @@
+Conway Makerspace System
Test Content
This is test content.
\ No newline at end of file
diff --git a/modules/kiosk/fixtures/TestRenderKioskLargeQR_large_qr.html b/modules/kiosk/fixtures/TestRenderKioskLargeQR_large_qr.html
new file mode 100644
index 0000000..2310e37
--- /dev/null
+++ b/modules/kiosk/fixtures/TestRenderKioskLargeQR_large_qr.html
@@ -0,0 +1,50 @@
+Conway Makerspace System
Link to Your Account
Scan the QR from your device to link the key fob to your account.
\ No newline at end of file
diff --git a/modules/kiosk/fixtures/TestRenderKiosk_empty_qr_bytes_empty_qr.html b/modules/kiosk/fixtures/TestRenderKiosk_empty_qr_bytes_empty_qr.html
new file mode 100644
index 0000000..fde4033
--- /dev/null
+++ b/modules/kiosk/fixtures/TestRenderKiosk_empty_qr_bytes_empty_qr.html
@@ -0,0 +1,50 @@
+Conway Makerspace System
Link to Your Account
Scan the QR from your device to link the key fob to your account.
\ No newline at end of file
diff --git a/modules/kiosk/fixtures/TestRenderKiosk_no_qr_code_no_qr.html b/modules/kiosk/fixtures/TestRenderKiosk_no_qr_code_no_qr.html
new file mode 100644
index 0000000..f338568
--- /dev/null
+++ b/modules/kiosk/fixtures/TestRenderKiosk_no_qr_code_no_qr.html
@@ -0,0 +1,50 @@
+Conway Makerspace System
Scan a key fob any time to link it to your account.
\ No newline at end of file
diff --git a/modules/kiosk/fixtures/TestRenderKiosk_with_qr_code_with_qr.html b/modules/kiosk/fixtures/TestRenderKiosk_with_qr_code_with_qr.html
new file mode 100644
index 0000000..7d3dfb7
--- /dev/null
+++ b/modules/kiosk/fixtures/TestRenderKiosk_with_qr_code_with_qr.html
@@ -0,0 +1,50 @@
+Conway Makerspace System
Link to Your Account
Scan the QR from your device to link the key fob to your account.
\ No newline at end of file
diff --git a/modules/kiosk/fixtures/TestRenderOffsiteError.html b/modules/kiosk/fixtures/TestRenderOffsiteError.html
new file mode 100644
index 0000000..80c3b3f
--- /dev/null
+++ b/modules/kiosk/fixtures/TestRenderOffsiteError.html
@@ -0,0 +1 @@
+Conway Makerspace System
Uh oh
You need to be at the physical makerspace to assign keyfobs.
\ No newline at end of file
diff --git a/modules/kiosk/kiosk_test.go b/modules/kiosk/kiosk_test.go
new file mode 100644
index 0000000..f4964d8
--- /dev/null
+++ b/modules/kiosk/kiosk_test.go
@@ -0,0 +1,61 @@
+package kiosk
+
+import (
+ "encoding/base64"
+ "testing"
+
+ snaptest "github.com/TheLab-ms/conway/internal/testing"
+)
+
+func TestRenderOffsiteError(t *testing.T) {
+ component := renderOffsiteError()
+ snaptest.RenderSnapshotWithName(t, component, "")
+}
+
+func TestRenderKiosk(t *testing.T) {
+ tests := []struct {
+ name string
+ qrImg []byte
+ fixtureName string
+ description string
+ }{
+ {
+ name: "no_qr_code",
+ qrImg: nil,
+ fixtureName: "_no_qr",
+ description: "Test kiosk view with no QR code (welcome screen)",
+ },
+ {
+ name: "with_qr_code",
+ qrImg: []byte("iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8/5+hHgAHggJ/PchI7wAAAABJRU5ErkJggg=="), // 1x1 transparent PNG in base64
+ fixtureName: "_with_qr",
+ description: "Test kiosk view with QR code for fob linking",
+ },
+ {
+ name: "empty_qr_bytes",
+ qrImg: []byte{},
+ fixtureName: "_empty_qr",
+ description: "Test kiosk view with empty byte slice (should show QR screen)",
+ },
+ }
+
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ component := renderKiosk(tt.qrImg)
+ snaptest.RenderSnapshotWithName(t, component, tt.fixtureName)
+ })
+ }
+}
+
+func TestRenderKioskLargeQR(t *testing.T) {
+ // Test with a larger QR code to ensure proper rendering
+ largePNG := make([]byte, 1024)
+ for i := range largePNG {
+ largePNG[i] = byte(i % 256)
+ }
+ encodedPNG := make([]byte, base64.StdEncoding.EncodedLen(len(largePNG)))
+ base64.StdEncoding.Encode(encodedPNG, largePNG)
+
+ component := renderKiosk(encodedPNG)
+ snaptest.RenderSnapshotWithName(t, component, "_large_qr")
+}
\ No newline at end of file
diff --git a/modules/machines/fixtures/TestRenderMachines_available_printers_available.html b/modules/machines/fixtures/TestRenderMachines_available_printers_available.html
new file mode 100644
index 0000000..aeac863
--- /dev/null
+++ b/modules/machines/fixtures/TestRenderMachines_available_printers_available.html
@@ -0,0 +1 @@
+Conway Makerspace System
Printers
Printer
Status
Print Completion Estimate
Error Code
Printer1
Available
Printer2
Available
E001
\ No newline at end of file
diff --git a/modules/machines/fixtures/TestRenderMachines_busy_printers_busy.html b/modules/machines/fixtures/TestRenderMachines_busy_printers_busy.html
new file mode 100644
index 0000000..c234c69
--- /dev/null
+++ b/modules/machines/fixtures/TestRenderMachines_busy_printers_busy.html
@@ -0,0 +1 @@
+Conway Makerspace System
Printers
Printer
Status
Print Completion Estimate
Error Code
BusyPrinter1
In Use
2h0m0s
BusyPrinter2
In Use
2h30m0s
W001
\ No newline at end of file
diff --git a/modules/machines/fixtures/TestRenderMachines_empty_printers_empty.html b/modules/machines/fixtures/TestRenderMachines_empty_printers_empty.html
new file mode 100644
index 0000000..5f48c0d
--- /dev/null
+++ b/modules/machines/fixtures/TestRenderMachines_empty_printers_empty.html
@@ -0,0 +1 @@
+Conway Makerspace System
Printers
Printer
Status
Print Completion Estimate
Error Code
\ No newline at end of file
diff --git a/modules/machines/fixtures/TestRenderMachines_mixed_status_mixed.html b/modules/machines/fixtures/TestRenderMachines_mixed_status_mixed.html
new file mode 100644
index 0000000..e1e33a4
--- /dev/null
+++ b/modules/machines/fixtures/TestRenderMachines_mixed_status_mixed.html
@@ -0,0 +1 @@
+Conway Makerspace System
Printers
Printer
Status
Print Completion Estimate
Error Code
AvailablePrinter
Available
BusyPrinter
In Use
2h0m0s
ErrorPrinter
Available
E502
BusyErrorPrinter
In Use
3h0m0s
W100
\ No newline at end of file
diff --git a/modules/machines/fixtures/TestRenderMachines_overdue_job_overdue.html b/modules/machines/fixtures/TestRenderMachines_overdue_job_overdue.html
new file mode 100644
index 0000000..8b2b878
--- /dev/null
+++ b/modules/machines/fixtures/TestRenderMachines_overdue_job_overdue.html
@@ -0,0 +1 @@
+Conway Makerspace System
Printers
Printer
Status
Print Completion Estimate
Error Code
OverduePrinter
In Use
-1h0m0s
\ No newline at end of file
diff --git a/modules/machines/fixtures/TestRenderMachines_single_printer_single.html b/modules/machines/fixtures/TestRenderMachines_single_printer_single.html
new file mode 100644
index 0000000..84c4063
--- /dev/null
+++ b/modules/machines/fixtures/TestRenderMachines_single_printer_single.html
@@ -0,0 +1 @@
+Conway Makerspace System
\ No newline at end of file
diff --git a/modules/members/fixtures/TestRenderMember_family_inactive_family_inactive.html b/modules/members/fixtures/TestRenderMember_family_inactive_family_inactive.html
new file mode 100644
index 0000000..f332a85
--- /dev/null
+++ b/modules/members/fixtures/TestRenderMember_family_inactive_family_inactive.html
@@ -0,0 +1 @@
+Conway Makerspace System
Family Member Inactive
Your membership is part of a family discount that is no longer valid due to the "root" member's account becoming inactive.
\ No newline at end of file
diff --git a/modules/members/fixtures/TestRenderMember_member_no_discord_no_discord.html b/modules/members/fixtures/TestRenderMember_member_no_discord_no_discord.html
new file mode 100644
index 0000000..99b8c1d
--- /dev/null
+++ b/modules/members/fixtures/TestRenderMember_member_no_discord_no_discord.html
@@ -0,0 +1 @@
+Conway Makerspace System
\ No newline at end of file
diff --git a/modules/members/fixtures/TestRenderMember_missing_keyfob_missing_keyfob.html b/modules/members/fixtures/TestRenderMember_missing_keyfob_missing_keyfob.html
new file mode 100644
index 0000000..f705cbb
--- /dev/null
+++ b/modules/members/fixtures/TestRenderMember_missing_keyfob_missing_keyfob.html
@@ -0,0 +1 @@
+Conway Makerspace System
Pick Up Your Key
You need an RFID key fob to access the space, but your account isn't currently linked to one. If you're at the space, you can add one using the kiosk near the front door.
\ No newline at end of file
diff --git a/modules/members/fixtures/TestRenderMember_missing_waiver_missing_waiver.html b/modules/members/fixtures/TestRenderMember_missing_waiver_missing_waiver.html
new file mode 100644
index 0000000..e8a7c93
--- /dev/null
+++ b/modules/members/fixtures/TestRenderMember_missing_waiver_missing_waiver.html
@@ -0,0 +1 @@
+Conway Makerspace System
Missing Liability Waiver
You will need to sign our liability waiver before entering the space.
\ No newline at end of file
diff --git a/modules/members/fixtures/TestRenderMember_payment_inactive_payment_inactive.html b/modules/members/fixtures/TestRenderMember_payment_inactive_payment_inactive.html
new file mode 100644
index 0000000..913f3b5
--- /dev/null
+++ b/modules/members/fixtures/TestRenderMember_payment_inactive_payment_inactive.html
@@ -0,0 +1 @@
+Conway Makerspace System
Missing Billing Information
Use the button below to set up payment with our secure payment processor.
\ No newline at end of file
diff --git a/modules/members/fixtures/TestRenderMembershipStatus_default_active_default_status.html b/modules/members/fixtures/TestRenderMembershipStatus_default_active_default_status.html
new file mode 100644
index 0000000..acb8206
--- /dev/null
+++ b/modules/members/fixtures/TestRenderMembershipStatus_default_active_default_status.html
@@ -0,0 +1 @@
+
Active Member
Your key fob is active!
\ No newline at end of file
diff --git a/modules/members/fixtures/TestRenderMembershipStatus_family_inactive_status_family_status.html b/modules/members/fixtures/TestRenderMembershipStatus_family_inactive_status_family_status.html
new file mode 100644
index 0000000..4ff1ad9
--- /dev/null
+++ b/modules/members/fixtures/TestRenderMembershipStatus_family_inactive_status_family_status.html
@@ -0,0 +1 @@
+
Family Member Inactive
Your membership is part of a family discount that is no longer valid due to the "root" member's account becoming inactive.
\ No newline at end of file
diff --git a/modules/members/fixtures/TestRenderMembershipStatus_missing_keyfob_status_keyfob_status.html b/modules/members/fixtures/TestRenderMembershipStatus_missing_keyfob_status_keyfob_status.html
new file mode 100644
index 0000000..c5a8e2b
--- /dev/null
+++ b/modules/members/fixtures/TestRenderMembershipStatus_missing_keyfob_status_keyfob_status.html
@@ -0,0 +1 @@
+
Pick Up Your Key
You need an RFID key fob to access the space, but your account isn't currently linked to one. If you're at the space, you can add one using the kiosk near the front door.
\ No newline at end of file
diff --git a/modules/members/fixtures/TestRenderMembershipStatus_missing_waiver_status_waiver_status.html b/modules/members/fixtures/TestRenderMembershipStatus_missing_waiver_status_waiver_status.html
new file mode 100644
index 0000000..9fe2717
--- /dev/null
+++ b/modules/members/fixtures/TestRenderMembershipStatus_missing_waiver_status_waiver_status.html
@@ -0,0 +1 @@
+
Missing Liability Waiver
You will need to sign our liability waiver before entering the space.
\ No newline at end of file
diff --git a/modules/members/fixtures/TestRenderMembershipStatus_payment_inactive_status_payment_status.html b/modules/members/fixtures/TestRenderMembershipStatus_payment_inactive_status_payment_status.html
new file mode 100644
index 0000000..8ea2f20
--- /dev/null
+++ b/modules/members/fixtures/TestRenderMembershipStatus_payment_inactive_status_payment_status.html
@@ -0,0 +1 @@
+
Missing Billing Information
Use the button below to set up payment with our secure payment processor.
\ No newline at end of file
diff --git a/modules/members/fixtures/TestRenderMembershipStatus_unknown_status_unknown_status.html b/modules/members/fixtures/TestRenderMembershipStatus_unknown_status_unknown_status.html
new file mode 100644
index 0000000..acb8206
--- /dev/null
+++ b/modules/members/fixtures/TestRenderMembershipStatus_unknown_status_unknown_status.html
@@ -0,0 +1 @@
+
1. I WAIVE ANY AND ALL RIGHTS OF RECOVERY, CLAIM, ACTION OR CAUSE OF ACTION AGAINST THELAB.MS FOR ANY INJURY OR DAMAGE THAT MAY OCCUR, REGARDLESS OF CAUSE OR ORIGIN, INCLUDING NEGLIGENCE AND GROSS NEGLIGENCE.
2. I also understand that I am personally responsible for my safety and actions and that I will follow all safety instructions and signage while at TheLab.ms.
3. I affirm that I am at least 18 years of age and mentally competent to sign this liability waiver.
\ No newline at end of file
diff --git a/modules/waiver/fixtures/TestRenderWaiver_signed_waiver_complex_redirect_signed_complex_redirect.html b/modules/waiver/fixtures/TestRenderWaiver_signed_waiver_complex_redirect_signed_complex_redirect.html
new file mode 100644
index 0000000..fe61a89
--- /dev/null
+++ b/modules/waiver/fixtures/TestRenderWaiver_signed_waiver_complex_redirect_signed_complex_redirect.html
@@ -0,0 +1,6 @@
+Conway Makerspace System
Waiver has been submitted successfully. You can print or screenshot this page for your records.
1. I WAIVE ANY AND ALL RIGHTS OF RECOVERY, CLAIM, ACTION OR CAUSE OF ACTION AGAINST THELAB.MS FOR ANY INJURY OR DAMAGE THAT MAY OCCUR, REGARDLESS OF CAUSE OR ORIGIN, INCLUDING NEGLIGENCE AND GROSS NEGLIGENCE.
2. I also understand that I am personally responsible for my safety and actions and that I will follow all safety instructions and signage while at TheLab.ms.
3. I affirm that I am at least 18 years of age and mentally competent to sign this liability waiver.
\ No newline at end of file
diff --git a/modules/waiver/fixtures/TestRenderWaiver_signed_waiver_no_redirect_signed_no_redirect.html b/modules/waiver/fixtures/TestRenderWaiver_signed_waiver_no_redirect_signed_no_redirect.html
new file mode 100644
index 0000000..853cb8f
--- /dev/null
+++ b/modules/waiver/fixtures/TestRenderWaiver_signed_waiver_no_redirect_signed_no_redirect.html
@@ -0,0 +1,6 @@
+Conway Makerspace System
Waiver has been submitted successfully. You can print or screenshot this page for your records.
TheLab Liability Waiver
I agree and acknowledge as follows:
1. I WAIVE ANY AND ALL RIGHTS OF RECOVERY, CLAIM, ACTION OR CAUSE OF ACTION AGAINST THELAB.MS FOR ANY INJURY OR DAMAGE THAT MAY OCCUR, REGARDLESS OF CAUSE OR ORIGIN, INCLUDING NEGLIGENCE AND GROSS NEGLIGENCE.
2. I also understand that I am personally responsible for my safety and actions and that I will follow all safety instructions and signage while at TheLab.ms.
3. I affirm that I am at least 18 years of age and mentally competent to sign this liability waiver.
\ No newline at end of file
diff --git a/modules/waiver/fixtures/TestRenderWaiver_signed_waiver_with_redirect_signed_with_redirect.html b/modules/waiver/fixtures/TestRenderWaiver_signed_waiver_with_redirect_signed_with_redirect.html
new file mode 100644
index 0000000..859a606
--- /dev/null
+++ b/modules/waiver/fixtures/TestRenderWaiver_signed_waiver_with_redirect_signed_with_redirect.html
@@ -0,0 +1,6 @@
+Conway Makerspace System
Waiver has been submitted successfully. You can print or screenshot this page for your records.
1. I WAIVE ANY AND ALL RIGHTS OF RECOVERY, CLAIM, ACTION OR CAUSE OF ACTION AGAINST THELAB.MS FOR ANY INJURY OR DAMAGE THAT MAY OCCUR, REGARDLESS OF CAUSE OR ORIGIN, INCLUDING NEGLIGENCE AND GROSS NEGLIGENCE.
2. I also understand that I am personally responsible for my safety and actions and that I will follow all safety instructions and signage while at TheLab.ms.
3. I affirm that I am at least 18 years of age and mentally competent to sign this liability waiver.
\ No newline at end of file
diff --git a/modules/waiver/fixtures/TestRenderWaiver_unsigned_special_chars_unsigned_special_chars.html b/modules/waiver/fixtures/TestRenderWaiver_unsigned_special_chars_unsigned_special_chars.html
new file mode 100644
index 0000000..1343c0e
--- /dev/null
+++ b/modules/waiver/fixtures/TestRenderWaiver_unsigned_special_chars_unsigned_special_chars.html
@@ -0,0 +1,6 @@
+Conway Makerspace System
TheLab Liability Waiver
I agree and acknowledge as follows:
1. I WAIVE ANY AND ALL RIGHTS OF RECOVERY, CLAIM, ACTION OR CAUSE OF ACTION AGAINST THELAB.MS FOR ANY INJURY OR DAMAGE THAT MAY OCCUR, REGARDLESS OF CAUSE OR ORIGIN, INCLUDING NEGLIGENCE AND GROSS NEGLIGENCE.
2. I also understand that I am personally responsible for my safety and actions and that I will follow all safety instructions and signage while at TheLab.ms.
3. I affirm that I am at least 18 years of age and mentally competent to sign this liability waiver.
\ No newline at end of file
diff --git a/modules/waiver/fixtures/TestRenderWaiver_unsigned_waiver_empty_unsigned_empty.html b/modules/waiver/fixtures/TestRenderWaiver_unsigned_waiver_empty_unsigned_empty.html
new file mode 100644
index 0000000..e4ac9e2
--- /dev/null
+++ b/modules/waiver/fixtures/TestRenderWaiver_unsigned_waiver_empty_unsigned_empty.html
@@ -0,0 +1,6 @@
+Conway Makerspace System
TheLab Liability Waiver
I agree and acknowledge as follows:
1. I WAIVE ANY AND ALL RIGHTS OF RECOVERY, CLAIM, ACTION OR CAUSE OF ACTION AGAINST THELAB.MS FOR ANY INJURY OR DAMAGE THAT MAY OCCUR, REGARDLESS OF CAUSE OR ORIGIN, INCLUDING NEGLIGENCE AND GROSS NEGLIGENCE.
2. I also understand that I am personally responsible for my safety and actions and that I will follow all safety instructions and signage while at TheLab.ms.
3. I affirm that I am at least 18 years of age and mentally competent to sign this liability waiver.
\ No newline at end of file
diff --git a/modules/waiver/fixtures/TestRenderWaiver_unsigned_waiver_with_data_unsigned_with_data.html b/modules/waiver/fixtures/TestRenderWaiver_unsigned_waiver_with_data_unsigned_with_data.html
new file mode 100644
index 0000000..13f31d4
--- /dev/null
+++ b/modules/waiver/fixtures/TestRenderWaiver_unsigned_waiver_with_data_unsigned_with_data.html
@@ -0,0 +1,6 @@
+Conway Makerspace System
TheLab Liability Waiver
I agree and acknowledge as follows:
1. I WAIVE ANY AND ALL RIGHTS OF RECOVERY, CLAIM, ACTION OR CAUSE OF ACTION AGAINST THELAB.MS FOR ANY INJURY OR DAMAGE THAT MAY OCCUR, REGARDLESS OF CAUSE OR ORIGIN, INCLUDING NEGLIGENCE AND GROSS NEGLIGENCE.
2. I also understand that I am personally responsible for my safety and actions and that I will follow all safety instructions and signage while at TheLab.ms.
3. I affirm that I am at least 18 years of age and mentally competent to sign this liability waiver.
\ No newline at end of file
diff --git a/modules/waiver/waiver_test.go b/modules/waiver/waiver_test.go
new file mode 100644
index 0000000..1ebfcb2
--- /dev/null
+++ b/modules/waiver/waiver_test.go
@@ -0,0 +1,90 @@
+package waiver
+
+import (
+ "testing"
+
+ snaptest "github.com/TheLab-ms/conway/internal/testing"
+)
+
+func TestRenderWaiver(t *testing.T) {
+ tests := []struct {
+ name string
+ signed bool
+ name_param string
+ email string
+ redirect string
+ fixtureName string
+ description string
+ }{
+ {
+ name: "unsigned_waiver_empty",
+ signed: false,
+ name_param: "",
+ email: "",
+ redirect: "",
+ fixtureName: "_unsigned_empty",
+ description: "Empty waiver form for new user",
+ },
+ {
+ name: "unsigned_waiver_with_data",
+ signed: false,
+ name_param: "John Doe",
+ email: "john@example.com",
+ redirect: "/dashboard",
+ fixtureName: "_unsigned_with_data",
+ description: "Waiver form pre-filled with user data",
+ },
+ {
+ name: "signed_waiver_no_redirect",
+ signed: true,
+ name_param: "Jane Smith",
+ email: "jane@example.com",
+ redirect: "",
+ fixtureName: "_signed_no_redirect",
+ description: "Successfully signed waiver without redirect",
+ },
+ {
+ name: "signed_waiver_with_redirect",
+ signed: true,
+ name_param: "Bob Johnson",
+ email: "bob@example.com",
+ redirect: "/kiosk",
+ fixtureName: "_signed_with_redirect",
+ description: "Successfully signed waiver with redirect to kiosk",
+ },
+ {
+ name: "signed_waiver_complex_redirect",
+ signed: true,
+ name_param: "Alice Wilson",
+ email: "alice@example.com",
+ redirect: "/admin/members?filter=new",
+ fixtureName: "_signed_complex_redirect",
+ description: "Successfully signed waiver with complex redirect URL",
+ },
+ {
+ name: "unsigned_special_chars",
+ signed: false,
+ name_param: "José García-López",
+ email: "jose.garcia+test@example.com",
+ redirect: "/test?param=value&other=123",
+ fixtureName: "_unsigned_special_chars",
+ description: "Waiver form with special characters and complex redirect",
+ },
+ {
+ name: "signed_special_chars",
+ signed: true,
+ name_param: "Marie-Claire O'Connor",
+ email: "marie.claire@example.co.uk",
+ redirect: "/success?msg=waiver_complete",
+ fixtureName: "_signed_special_chars",
+ description: "Signed waiver with special characters in name",
+ },
+ }
+
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ component := renderWaiver(tt.signed, tt.name_param, tt.email, tt.redirect)
+ snaptest.RenderSnapshotWithName(t, component, tt.fixtureName)
+ })
+ }
+}
\ No newline at end of file