Skip to content

Commit 73bb413

Browse files
committed
fix(test): fix failing test in history view.
1 parent fda2636 commit 73bb413

4 files changed

Lines changed: 17 additions & 7 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,24 @@ on:
1515
- ".swift-format"
1616
workflow_dispatch:
1717

18+
permissions:
19+
contents: read
20+
21+
concurrency:
22+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
23+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
24+
1825
jobs:
1926
build:
2027
name: Build and test
2128
runs-on: macos-26
29+
timeout-minutes: 45
2230

2331
steps:
2432
- name: Checkout
2533
uses: actions/checkout@v4
34+
with:
35+
persist-credentials: false
2636

2737
- name: Set XCode version
2838
uses: maxim-lobanov/setup-xcode@v1

‎Snapper/Features/AlbumHistory/AlbumHistoryView.swift‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ private struct AlbumHistoryContent: View {
5353
)
5454
.onAppear { vm.isSelecting = false }
5555
.overlay {
56-
if history.isEmpty {
56+
if history.isEmpty && vm.searchText.isEmpty {
5757
ContentUnavailableView {
5858
Text("No albums yet")
5959
.font(.libreCaslonTextBold(.headline))
@@ -62,7 +62,7 @@ private struct AlbumHistoryContent: View {
6262
.font(.libreCaslonTextRegular(.subheadline))
6363
}
6464
} else if history.isEmpty {
65-
ContentUnavailableView.search
65+
ContentUnavailableView.search(text: vm.searchText)
6666
}
6767
}
6868
.searchable(

‎Snapper/Resources/albums.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"id": "6F5D5170-47D6-4E95-A14C-4ECA026F1C7D",
3535
"discogsReleaseId": 23301476,
3636
"artist": "Harry Styles",
37-
"title": "Harry’s House",
37+
"title": "Harry's House",
3838
"year": 2022,
3939
"formats": ["CD", "Album", "Stereo"],
4040
"labels": [

‎SnapperUITests/AlbumHistoryUITests.swift‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ final class AlbumHistoryUITests: XCTestCase {
77
app.launchArguments.append("-ui-testing-seed-albums")
88
app.launch()
99

10-
let historyTab = app.tabBars.buttons["History"]
10+
let historyTab = app.tabBars.buttons["clock"]
1111
XCTAssertTrue(historyTab.waitForExistence(timeout: 10))
1212
historyTab.tap()
1313

@@ -16,7 +16,7 @@ final class AlbumHistoryUITests: XCTestCase {
1616
searchField.tap()
1717
searchField.typeText("House")
1818

19-
let matchingAlbum = app.staticTexts["Harry’s House"]
19+
let matchingAlbum = app.staticTexts["Harry's House"]
2020
XCTAssertTrue(matchingAlbum.waitForExistence(timeout: 10))
2121

2222
let otherAlbum = app.staticTexts["Kiss All The Time. Disco, Occasionally."]
@@ -38,12 +38,12 @@ final class AlbumHistoryUITests: XCTestCase {
3838
app.launchArguments.append("-ui-testing-seed-albums")
3939
app.launch()
4040

41-
let historyTab = app.tabBars.buttons["History"]
41+
let historyTab = app.tabBars.buttons["clock"]
4242
XCTAssertTrue(historyTab.waitForExistence(timeout: 10))
4343
historyTab.tap()
4444

4545
let deletedAlbum = app.staticTexts["Kiss All The Time. Disco, Occasionally."]
46-
let retainedAlbum = app.staticTexts["Harry’s House"]
46+
let retainedAlbum = app.staticTexts["Harry's House"]
4747
XCTAssertTrue(deletedAlbum.waitForExistence(timeout: 10))
4848
XCTAssertTrue(retainedAlbum.exists)
4949

0 commit comments

Comments
 (0)