MCPcopy
hub / github.com/docker/docker-agent / TestRemoveLast

Function TestRemoveLast

pkg/tui/components/transcript/transcript_test.go:151–166  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

149}
150
151func TestRemoveLast(t *testing.T) {
152 t.Parallel()
153 tr := newTestTranscript()
154 defer tr.StopAnimations()
155
156 _ = tr.Append(types.User("hello"))
157 _ = tr.Append(types.Spinner())
158 require.True(t, tr.LastIs(types.MessageTypeSpinner))
159
160 tr.RemoveLast(types.MessageTypeSpinner)
161 assert.True(t, tr.LastIs(types.MessageTypeUser))
162
163 // Wrong type: no-op.
164 tr.RemoveLast(types.MessageTypeSpinner)
165 assert.True(t, tr.LastIs(types.MessageTypeUser))
166}
167
168func TestRebuildPreservesContent(t *testing.T) {
169 t.Parallel()

Callers

nothing calls this directly

Calls 7

UserFunction · 0.92
SpinnerFunction · 0.92
newTestTranscriptFunction · 0.85
StopAnimationsMethod · 0.80
LastIsMethod · 0.80
RemoveLastMethod · 0.80
AppendMethod · 0.45

Tested by

no test coverage detected