Add feature tests for shop functionality and organization purchases
Deploy Test / test (push) Successful in 1m38s
Deploy Test / deploy (push) Successful in 31s

- Implement OfferOptionAdminTest to validate offer option management, including price display, activation, and cancellation.
- Create OrganizationPurchaseTest to ensure correct handling of organization purchases, including access control and order processing.
- Add ShopProductPageTest to verify shop product listings, search functionality, and product page details.
- Introduce BuildsShop trait for seeding test data related to shop functionality.
- Implement MoneyTest to validate money parsing and formatting, ensuring correct handling of euro amounts.
This commit is contained in:
Lars committed 2026-11-21 12:06:24 +01:00
1 parent 6c8bbee363
commit 4e0760db1e
106 files changed
+4068 -76

No files matched your search

+284
View File
@@ -0,0 +1,284 @@
/*
* Shop (Etappe 1): Produktseite mit Lizenzoptionen, Shop-Suche, Warenkorb und Kasse.
* Nur Bedeutungswerte aus tokens.css; keine eigenen Farben. Zustand wird nie allein durch Farbe vermittelt
* (jede Markierung trägt Text).
*/
.shop-options {
margin-top: var(--space-7);
}
.shop-options-lede,
.shop-note {
color: var(--color-text-muted);
max-width: var(--measure);
}
.shop-option-list,
.shop-lines,
.shop-tiles {
list-style: none;
margin: var(--space-5) 0;
padding: 0;
display: grid;
gap: var(--space-4);
}
.shop-option,
.shop-line,
.shop-tile {
background: var(--color-surface-raised);
border: 1px solid var(--color-border);
border-radius: var(--radius-card);
padding: var(--space-5);
}
.shop-option h3,
.shop-line h2,
.shop-tile h2 {
margin: 0 0 var(--space-2);
}
.shop-option h4 {
margin: var(--space-4) 0 var(--space-2);
font-size: var(--text-body);
}
.shop-price {
white-space: nowrap;
font-size: var(--text-h3);
font-weight: 700;
color: var(--color-heading);
margin: 0 0 var(--space-3);
}
.shop-price.is-struck {
color: var(--color-text-muted);
text-decoration: line-through;
}
.shop-price-old {
color: var(--color-text-muted);
font-weight: 400;
margin-right: var(--space-2);
}
.shop-facts {
display: flex;
flex-wrap: wrap;
gap: var(--space-2) var(--space-5);
margin: 0 0 var(--space-3);
}
.shop-facts div {
display: grid;
}
.shop-facts dt {
color: var(--color-text-muted);
font-size: var(--text-small);
}
.shop-facts dd {
margin: 0;
font-weight: 600;
}
.shop-scope {
list-style: none;
margin: 0 0 var(--space-4);
padding: 0;
display: grid;
gap: var(--space-2);
}
.shop-scope li {
display: grid;
}
.shop-scope span {
color: var(--color-text-muted);
font-size: var(--text-small);
}
.shop-actions {
display: flex;
flex-wrap: wrap;
gap: var(--space-3);
align-items: center;
}
.shop-actions form {
margin: 0;
}
.shop-switch {
max-width: var(--measure);
}
.shop-in-cart {
font-weight: 600;
margin: 0;
}
.shop-search {
display: flex;
flex-wrap: wrap;
gap: var(--space-3);
align-items: end;
margin: var(--space-5) 0;
}
.shop-search label {
flex-basis: 100%;
font-weight: 600;
}
.shop-search input[type='search'],
.shop-holder select {
font: inherit;
min-height: var(--touch-target);
border: 1px solid var(--color-border-strong);
border-radius: var(--radius-small);
padding: 0.5rem 0.75rem;
background: var(--color-surface);
color: var(--color-text);
flex: 1 1 16rem;
max-width: 28rem;
}
.shop-holder {
display: flex;
flex-wrap: wrap;
gap: var(--space-3);
align-items: center;
margin: 0 0 var(--space-4);
}
.shop-holder label {
font-weight: 600;
}
.shop-count {
color: var(--color-text-muted);
margin: 0;
}
.shop-tiles {
grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
}
.shop-tile-price {
font-weight: 600;
margin: var(--space-3) 0 0;
}
.shop-line {
display: grid;
gap: var(--space-4);
}
.shop-line.is-owned {
background: var(--color-surface-subtle);
}
.shop-line.is-blocked {
border-color: var(--color-danger);
border-width: 2px;
}
.shop-line-option {
margin: 0 0 var(--space-3);
color: var(--color-text-muted);
}
.shop-badge {
display: inline-block;
margin: 0 0 var(--space-2);
padding: 0.15rem 0.7rem;
border-radius: var(--radius-pill);
border: 2px solid currentColor;
font-weight: 700;
font-size: var(--text-small);
}
.shop-badge-owned {
color: var(--color-success);
background: var(--color-success-surface);
}
.shop-badge-changed {
color: var(--color-warning);
background: var(--color-warning-surface);
}
.shop-badge-blocked {
color: var(--color-danger);
background: var(--color-danger-surface);
}
.shop-total {
margin: var(--space-5) 0;
padding-top: var(--space-4);
border-top: 2px solid var(--color-border-strong);
}
.shop-total p:first-child {
display: flex;
justify-content: space-between;
gap: var(--space-4);
font-size: var(--text-h3);
margin: 0 0 var(--space-2);
max-width: 32rem;
}
.shop-cart-count {
font-weight: 700;
}
/* Sichtbare Anzahl am Warenkorbsymbol; die Anzahl steht zusätzlich im Namen des Links. */
.site-icon-link:has(.shop-cart-badge) {
position: relative;
}
.shop-cart-badge {
position: absolute;
top: -0.35rem;
right: -0.35rem;
min-width: 1.35rem;
height: 1.35rem;
padding: 0 0.3rem;
border-radius: var(--radius-pill);
background: var(--color-accent);
color: var(--lf-navy);
font-size: 0.8rem;
font-weight: 800;
line-height: 1.35rem;
text-align: center;
}
.shop-order-summary {
max-width: 40rem;
}
.shop-order-summary li {
flex-wrap: wrap;
display: flex;
justify-content: space-between;
gap: var(--space-4);
}
@media (min-width: 48rem) {
.shop-line {
grid-template-columns: minmax(0, 1fr) auto;
align-items: start;
}
.shop-line-side {
text-align: right;
}
.shop-line-side .shop-actions {
justify-content: flex-end;
}
}