From 74048f772ef11fae8f5acc6f4afe5a09742faa80 Mon Sep 17 00:00:00 2001 From: Gusted Date: Sun, 10 Nov 2024 14:49:13 +0100 Subject: [PATCH] fix: Add created_unix and updated_unix to repo1 fixture --- models/fixtures/repository.yml | 3 ++- tests/integration/last_updated_time_test.go | 7 ++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/models/fixtures/repository.yml b/models/fixtures/repository.yml index 51f526f889..f7aaad1f31 100644 --- a/models/fixtures/repository.yml +++ b/models/fixtures/repository.yml @@ -29,7 +29,8 @@ size: 7597 is_fsck_enabled: true close_issues_via_commit_in_any_branch: false - + created_unix: 1731254961 + updated_unix: 1731254961 - id: 2 owner_id: 2 diff --git a/tests/integration/last_updated_time_test.go b/tests/integration/last_updated_time_test.go index 1d9240a31f..0f8d2da03e 100644 --- a/tests/integration/last_updated_time_test.go +++ b/tests/integration/last_updated_time_test.go @@ -20,7 +20,7 @@ func TestRepoLastUpdatedTime(t *testing.T) { req := NewRequest(t, "GET", "/explore/repos?q=repo1") resp := session.MakeRequest(t, req, http.StatusOK) doc := NewHTMLParser(t, resp.Body) - node := doc.doc.Find(".flex-item-body").First() + node := doc.doc.Find(".flex-item-main:has(a[href='/user2/repo1']) .flex-item-body").First() { buf := "" findTextNonNested(t, node, &buf) @@ -28,10 +28,7 @@ func TestRepoLastUpdatedTime(t *testing.T) { } // Relative time should be present as a descendent - { - relativeTime := node.Find("relative-time").Text() - assert.True(t, strings.HasPrefix(relativeTime, "19")) // ~1970, might underflow with timezone - } + assert.Contains(t, node.Find("relative-time").Text(), "2024-11-10") } func TestBranchLastUpdatedTime(t *testing.T) {