Files
moteva/server/internal/logic/auth_mapper_test.go
T

17 lines
502 B
Go
Raw Normal View History

package logic
import (
"testing"
"time"
authmodule "img_infinite_canvas/internal/modules/auth"
)
func TestAccountDeviceMapperReturnsTimezoneNeutralTimestamp(t *testing.T) {
lastSeenAt := time.Date(2026, 7, 11, 16, 51, 0, 0, time.FixedZone("CST", 8*60*60))
devices := toAPIAccountDevices([]authmodule.Device{{ID: "session-1", LastSeenAt: lastSeenAt}})
if len(devices) != 1 || devices[0].LastSeenAt != "2026-07-11T08:51:00Z" {
t.Fatalf("expected RFC3339 UTC timestamp, got %#v", devices)
}
}