Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
111 changes: 99 additions & 12 deletions scripts/specs/evidence/declarations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,48 @@ import {
EvidenceCaptureDeclarationSchema,
} from "./schema.ts";

const SERVICING_STUDIO_CSS = `
const brandedThemeCss = (
borderRadius: string,
accent: string,
background: string,
secondaryBackground: string,
link: string,
secondary: string,
secondaryAccent: string,
shadow: string,
table: string,
text: string,
secondaryText: string,
): string => `
:root {
--border-radius: 5px;
--color-accent: #c28b52;
--color-bg: #e9edef;
--color-bg-secondary: #d8e0e3;
--color-link: #315b67;
--color-secondary: #315b67;
--color-secondary-accent: #315b6718;
--color-shadow: #263f4724;
--color-table: #315b67;
--color-text: #27383d;
--color-text-secondary: #66777c;
--border-radius: ${borderRadius};
--color-accent: ${accent};
--color-bg: ${background};
--color-bg-secondary: ${secondaryBackground};
--color-link: ${link};
--color-secondary: ${secondary};
--color-secondary-accent: ${secondaryAccent};
--color-shadow: ${shadow};
--color-table: ${table};
--color-text: ${text};
--color-text-secondary: ${secondaryText};
--font-family: Arial, Helvetica, sans-serif;
}
`;

const SERVICING_STUDIO_CSS = `${brandedThemeCss(
"5px",
"#c28b52",
"#e9edef",
"#d8e0e3",
"#315b67",
"#315b67",
"#315b6718",
"#263f4724",
"#315b67",
"#27383d",
"#66777c",
)}

#servicing-form {
background: #f9faf8;
Expand Down Expand Up @@ -74,6 +101,57 @@ const SERVICING_STUDIO_CSS = `
}
`;

const PAYMENT_PROVIDER_CSS = `${brandedThemeCss(
"8px",
"#d7ab48",
"#eef3f2",
"#dde8e5",
"#245e59",
"#244c48",
"#244c4818",
"#1e454020",
"#244c48",
"#263a38",
"#647471",
)}

.admin-page {
background: #fff;
border: 1px solid #c9d8d4;
border-top: 6px solid var(--color-accent);
box-shadow: 0 12px 28px var(--color-shadow);
padding: 1rem;
}

.admin-page > form:not(#settings-payment-provider):not(#settings-stripe),
.admin-page > article,
.admin-page > footer {
display: none;
}

#settings-payment-provider,
#settings-stripe {
background: #f8faf9;
border: 1px solid #c9d8d4;
border-radius: var(--border-radius);
padding: 1rem;
}

#settings-payment-provider h2,
#settings-stripe h2 {
color: var(--color-secondary);
}

#settings-payment-provider .radio-option {
background: #fff;
border-color: #c9d8d4;
}

#settings-stripe .notice {
border-left: 5px solid var(--color-accent);
}
`;

export const EVIDENCE_CAPTURES: EvidenceCaptureDeclaration[] = [
v.parse(EvidenceCaptureDeclarationSchema, {
caseId: "servicing.hold-on-dashboard",
Expand All @@ -84,4 +162,13 @@ export const EVIDENCE_CAPTURES: EvidenceCaptureDeclaration[] = [
presentation: "branded",
profiles: ["mobile"],
}),
v.parse(EvidenceCaptureDeclarationSchema, {
caseId: "payments.select-saved-stripe",
css: PAYMENT_PROVIDER_CSS,
element: ".page-regions.admin-page",
id: "payment-provider-choice",
path: "/admin/settings",
presentation: "branded",
profiles: ["mobile"],
}),
];
18 changes: 18 additions & 0 deletions specs/bookings/volunteer-sign-up.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
@story:bookings.volunteer-sign-up
@owner:attendees @risk:medium
@actor:customer @actor:organiser
@edition:managed @edition:self-hosted
Feature: A volunteer signs up for a free shift
A volunteer can choose one shift and share an access need without paying.
The organiser can see the volunteer and their answer on the chosen shift.

@rule:bookings.free-shift-is-recorded
Rule: A free shift sign-up appears on the organiser's attendee list
The confirmation and attendee list show the shift the volunteer chose.

@case:bookings.volunteer-chooses-shift
Scenario: Sam signs up for the set-up shift
Given Oakfield has three volunteer shifts with eight places each
When Sam signs up for the set-up shift and asks for step-free access
Then Sam receives a free booking confirmation for the set-up shift
And the organiser sees Sam and the access note on the set-up shift
2 changes: 1 addition & 1 deletion specs/owners.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"owners": ["attendees", "payments", "servicing"]
"owners": ["attendees", "bookings", "payments", "servicing"]
}
17 changes: 17 additions & 0 deletions specs/payments/payment-provider-choice.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
@story:payments.provider-choice
@owner:payments @risk:medium
@actor:organiser
@edition:managed @edition:self-hosted
Feature: An organiser chooses a payment provider
An organiser can switch between supported payment providers.
A saved provider setup remains available when selected again.

@rule:payments.saved-provider-can-be-selected
Rule: A saved test setup remains available after switching providers
Selecting a provider makes it active without removing its saved key.

@case:payments.select-saved-stripe
Scenario: The organiser switches back to a saved Stripe test setup
Given a Stripe test key is saved while Square takes payments
When the organiser changes the payment provider to Stripe
Then the payment settings show Stripe selected with its saved key in test mode
Loading