Skip to content

Commit ca59ea3

Browse files
authored
Merge pull request #88 from jevonmao/release_1.5.1
Project clean up & accesibility
2 parents b4a7302 + 66a73d1 commit ca59ea3

File tree

7 files changed

+35
-1
lines changed

7 files changed

+35
-1
lines changed

Package.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,5 +131,6 @@ let package = Package(
131131
exclude: [],
132132
resources: [.process("__Snapshots__")]
133133
),
134+
134135
] + permissionsTargets
135136
)

Sources/CorePermissionsSwiftUI/Model/Mocks/MockHealthManager.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import Foundation
99
#if !os(tvOS) && PERMISSIONSWIFTUI_HEALTH
1010
import HealthKit
11-
1211
protocol HealthManager {
1312
func authorizationStatus(for type: HKObjectType) -> HKAuthorizationStatus
1413
func requestAuthorization(toShare typesToShare: Set<HKSampleType>?, read typesToRead: Set<HKObjectType>?, completion: @escaping (Bool, Error?) -> Void)

Sources/CorePermissionsSwiftUI/SwiftUI/Shared/AllowButtonSection.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@ struct AllowButtonSection: View {
1818
.buttonStatusColor(for: allowButtonStatus)
1919
})
2020
.layoutPriority(-1)
21+
.accessibility(identifier: "Allow button")
2122
}
2223
}

Sources/CorePermissionsSwiftUI/SwiftUI/Shared/ExitButtonSection.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ struct ExitButtonSection: View {
3838
.padding(4)
3939
)
4040
})
41+
.accessibility(identifier: "Exit button")
4142
}
4243
}
4344

Sources/CorePermissionsSwiftUI/SwiftUI/Shared/HeaderView.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ struct HeaderView: View {
2727
.frame(maxWidth:.infinity, alignment: .leading)
2828
//Negative padding make the bottom title "shift up" a little
2929
.padding(.vertical, -5)
30+
.accessibility(identifier: "Alert header")
3031
}
3132

3233
HStack {
@@ -37,6 +38,7 @@ struct HeaderView: View {
3738
.minimumScaleFactor(0.85)
3839
.allowsTightening(true)
3940
.layoutPriority(1)
41+
.accessibility(identifier: "Main title")
4042

4143

4244
Spacer()
@@ -66,6 +68,7 @@ struct HeaderView: View {
6668
//Allow scacling down to half the original size on smaller screens
6769
.minimumScaleFactor(0.5)
6870
.textHorizontalAlign(.leading)
71+
.accessibility(identifier: "Modal header description")
6972
}
7073

7174
}

Sources/CorePermissionsSwiftUI/SwiftUI/Shared/PermissionSectionCell.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,18 +59,23 @@ struct PermissionSectionCell: View {
5959
.font(.system(size: screenSizeConstant))
6060
.frame(width: screenSizeConstant)
6161
.padding(.horizontal, 5)
62+
.accessibility(identifier: "Permission icon")
63+
6264
VStack(alignment: .leading) {
6365
Text(currentPermission.title)
6466
.font(.system(size: fontSizeConstant))
6567
.bold()
6668
.lineLimit(1)
6769
.minimumScaleFactor(0.7)
6870
.layoutPriority(1)
71+
.accessibility(identifier: "Permission title")
72+
6973
Text(currentPermission.description)
7074
.font(.system(size: smallFontSizeConstant))
7175
.lineLimit(3)
7276
.foregroundColor(Color(.systemGray2))
7377
.minimumScaleFactor(0.5)
78+
.accessibility(identifier: "Permission description")
7479

7580
}
7681
.padding(.horizontal, 3)
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
//
2+
// UITests.swift
3+
//
4+
//
5+
// Created by Jevon Mao on 6/15/21.
6+
//
7+
8+
import Foundation
9+
import XCTest
10+
11+
final class UITests: XCTestCase {
12+
var app: XCUIApplication!
13+
14+
override func setUp() {
15+
continueAfterFailure = false
16+
app = XCUIApplication()
17+
app.launchArguments = ["testing"]
18+
app.launch()
19+
}
20+
21+
func testTitle() {
22+
//XCTAssertTrue(app.staticTexts["Hello World!"].exists)
23+
}
24+
}

0 commit comments

Comments
 (0)