Catering, and a pure Java/Spring site: Thymeleaf front to back #10

Merged
austin merged 22 commits from feature/catering-tables into main 2026-07-26 21:26:57 -05:00
2 changed files with 25 additions and 0 deletions
Showing only changes of commit eb5f75bc9d - Show all commits
@@ -87,6 +87,15 @@ const Notes = ({
> >
<Icon d={ARROW_UP} /> <Icon d={ARROW_UP} />
</button> </button>
<button
type="button"
className={iconButton}
disabled={disabled || i === notes.length - 1}
onClick={() => onChange(shift(notes, i, 1))}
aria-label="Move note down"
>
<Icon d={ARROW_DOWN} />
</button>
<button <button
type="button" type="button"
className={iconButton} className={iconButton}
@@ -204,6 +204,22 @@ class CateringMenuTest {
.contains("Holiday boxes"); .contains("Holiday boxes");
} }
@Test
void deletingATableTakesItsColumnsLinesAndCellsWithIt() {
CateringMenu.PackageView weddings = catering.everything().packages().get(2);
catering.remove(weddings.id());
// Flushed on purpose: a delete that leaves its children behind fails against the real foreign
// keys, not in memory, and this one is a button on the admin screen.
entityManager.flush();
entityManager.clear();
assertThat(catering.everything().packages()).extracting(CateringMenu.PackageView::name)
.containsExactly("Office", "Parties");
// The page's own terms outlive any one table.
assertThat(catering.menu().notes()).hasSize(2);
}
@Test @Test
void putsTheTablesWhereTheEditorLeftThem() { void putsTheTablesWhereTheEditorLeftThem() {
List<CateringMenu.PackageView> tables = catering.everything().packages(); List<CateringMenu.PackageView> tables = catering.everything().packages();