TestCreateErrorResult tests the createErrorResult helper function
(t *testing.T)
| 1980 | |
| 1981 | // TestCreateErrorResult tests the createErrorResult helper function |
| 1982 | func TestCreateErrorResult(t *testing.T) { |
| 1983 | component := app.SnapshotComponent{ |
| 1984 | Name: "test-component", |
| 1985 | ContainerImage: "registry.com/image:tag", |
| 1986 | } |
| 1987 | err := errors.New("test error") |
| 1988 | |
| 1989 | result := createErrorResult(component, err) |
| 1990 | |
| 1991 | assert.Equal(t, component.Name, result.ComponentName) |
| 1992 | assert.Equal(t, component.ContainerImage, result.ImageRef) |
| 1993 | assert.Equal(t, err, result.Error) |
| 1994 | |
| 1995 | // Result should be populated with ValidationResult created from error |
| 1996 | assert.NotNil(t, result.Result) |
| 1997 | assert.Equal(t, "test error", result.Result.Message) |
| 1998 | assert.False(t, result.Result.Passed) |
| 1999 | assert.False(t, result.Result.SignatureVerified) |
| 2000 | assert.Equal(t, "retrieval_failed", result.Result.ReasonCode) |
| 2001 | |
| 2002 | assert.Nil(t, result.FallbackResult) |
| 2003 | } |
| 2004 | |
| 2005 | func TestBuildHeaderDisplay(t *testing.T) { |
| 2006 | // Test with a specific timestamp |
nothing calls this directly
no test coverage detected