oficina / slides Public

Slides editor test: count strip items by attribute, not by the exact tag text

The strip's items now carry slides-lit, and the test matched the <li>'s
attributes as one literal string, so it counted none (hub CI on d00eaf1).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by paul@keymail.dev 8c0d23152698ca4f790bfc0faf04abbf835afa2a parent d00eaf1
1 file changed, +1 −1
  • internal/slidestest/editor_test.go +1 −1

CI passed — run details

diff --git a/internal/slidestest/editor_test.go b/internal/slidestest/editor_test.go
index 1265946..80a219f 100644
--- a/internal/slidestest/editor_test.go
+++ b/internal/slidestest/editor_test.go
@@ -67,7 +67,7 @@ func TestEditorPageLinksTheCommittedBundle(t *testing.T) {
// of it (thumbs.go), the current one saying so in words.
// The <template> the bundle clones for a new slide is an item too,
// with no slide id; the eight with one are the deck's.
- if n := strings.Count(page, `<li slides-strip-item draggable="true" data-slide-id="`); n != 8 {
+ if n := len(regexp.MustCompile(`<li slides-strip-item[^>]*\sdata-slide-id="`).FindAllString(page, -1)); n != 8 {
t.Errorf("the strip lists %d slides, want the sample deck's 8:\n%s", n, page)
}
// One section on the page, and it is the stage. The strip used to