Run demos at the size they are recorded at

How a demo behaves depends on how much of a list fits on the screen, and
`just e2e` ran demos on a 150x100 screen while we record them at 120x35.
So a demo could pass the test suite and still fail partway through a
recording, and there was no way to find out short of recording it.

Give a demo the recording size when it doesn't ask for a size of its
own.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Stefan Haller
2026-10-01 17:28:31 +02:00
co-authored by Claude Opus 5
parent 84627fabac
commit 31aa870a3b
+12
View File
@@ -23,6 +23,14 @@ const (
defaultHeight = 100
)
// The terminal size that demo/settings.tape gives a recording. How a demo
// behaves depends on how much of a list fits on the screen, so run demos at
// the size they will be recorded at. Keep these in step with that file.
const (
demoWidth = 120
demoHeight = 35
)
type IntegrationTest struct {
name string
description string
@@ -213,6 +221,10 @@ func (self *IntegrationTest) Run(gui integrationTypes.GuiDriver) {
func (self *IntegrationTest) HeadlessDimensions() (int, int) {
if self.width == 0 && self.height == 0 {
if self.isDemo {
return demoWidth, demoHeight
}
return defaultWidth, defaultHeight
}