Skip to content

Commit 409f137

Browse files
test(backend, logger): parcial complete of logger_test missing one test
1 parent 07ed6a3 commit 409f137

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

backend/pkg/logger/data/logger_test.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ func TestStart(t *testing.T) {
9494

9595
func TestPushRecord(t *testing.T) {
9696

97-
_ = chdirTemp(t) // Change to a temporary directory
97+
//_ = chdirTemp(t) // Change to a temporary directory
9898

9999
boardName := "Pikachu"
100100

@@ -175,7 +175,6 @@ func TestPushRecord(t *testing.T) {
175175
}
176176
})
177177

178-
// --- START: nueva verificación antes de detener ---
179178
// read and store current file contents to compare later
180179
filePath := filepath.Join("logger", loggerHandler.Timestamp.Format(loggerHandler.TimestampFormat), "data", strings.ToUpper(boardName), valueName+".csv")
181180
time.Sleep(200 * time.Millisecond) // small wait to stabilize
@@ -184,7 +183,6 @@ func TestPushRecord(t *testing.T) {
184183
t.Fatalf("could not read file before stopping logger: %v", err)
185184
}
186185
before := strings.TrimSpace(string(beforeBytes))
187-
// --- END: nueva verificación antes de detener ---
188186

189187
// stop the logger
190188
logger.Stop()
@@ -528,8 +526,11 @@ func runCreateFile_Success(t *testing.T) {
528526
t.Fatalf("expected prefix 'logger', got %q", parts[0])
529527
}
530528

531-
// TODO: after refactor, we should be able to assert the date folder
532-
// parts[1] is the date folder → we intentionally do NOT assert its value
529+
// parts[1] is the date folder
530+
531+
if parts[1] != loggerHandler.Timestamp.Format(loggerHandler.TimestampFormat) {
532+
t.Fatalf("expected folder '%s', got %q", loggerHandler.Timestamp.Format(loggerHandler.TimestampFormat), parts[2])
533+
}
533534

534535
if parts[2] != "data" {
535536
t.Fatalf("expected folder 'data', got %q", parts[2])

0 commit comments

Comments
 (0)