package app import ( "testing" "time" "github.com/stretchr/testify/assert" ) func TestGetStartOfWeek(t *testing.T) { t.Run("monday", func(t *testing.T) { date, _ := time.Parse("2006-01-02 15:04:05", "2024-10-14 00:00:01") assert.Equal(t, int64(1728864000), getStartOfWeek(date)) }) t.Run("sunday", func(t *testing.T) { date, _ := time.Parse("2006-01-02 15:04:05", "2024-10-20 23:59:59") assert.Equal(t, int64(1728864000), getStartOfWeek(date)) }) }