mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 12:07:55 +00:00
Add UI tests for accepting space invites. (#4602)
* Fix the space visibility icon size in the join room screen. * Add a UI test for accepting space invites.
This commit is contained in:
@@ -17,6 +17,7 @@ struct ClientProxyMockConfiguration {
|
||||
var spaceServiceConfiguration: SpaceServiceProxyMock.Configuration = .init()
|
||||
var roomPreviews: [RoomPreviewProxyProtocol]?
|
||||
var roomDirectorySearchProxy: RoomDirectorySearchProxyProtocol?
|
||||
var overrides = Overrides()
|
||||
|
||||
var recoveryState: SecureBackupRecoveryState = .enabled
|
||||
|
||||
@@ -26,6 +27,10 @@ struct ClientProxyMockConfiguration {
|
||||
var hideInviteAvatars = false
|
||||
|
||||
var maxMediaUploadSize: UInt = 100 * 1024 * 1024
|
||||
|
||||
class Overrides {
|
||||
var joinedRoomIDs: Set<String> = []
|
||||
}
|
||||
}
|
||||
|
||||
enum ClientProxyMockError: Error {
|
||||
@@ -67,6 +72,11 @@ extension ClientProxyMock {
|
||||
createDirectRoomWithExpectedRoomNameReturnValue = .failure(.sdkError(ClientProxyMockError.generic))
|
||||
createRoomNameTopicIsRoomPrivateIsKnockingOnlyUserIDsAvatarURLAliasLocalPartReturnValue = .failure(.sdkError(ClientProxyMockError.generic))
|
||||
canJoinRoomWithReturnValue = true
|
||||
joinRoomViaClosure = { roomID, _ in
|
||||
configuration.overrides.joinedRoomIDs.insert(roomID)
|
||||
return .success(())
|
||||
}
|
||||
joinRoomAliasReturnValue = .success(())
|
||||
uploadMediaReturnValue = .failure(.sdkError(ClientProxyMockError.generic))
|
||||
loadUserDisplayNameReturnValue = .failure(.sdkError(ClientProxyMockError.generic))
|
||||
setUserDisplayNameReturnValue = .failure(.sdkError(ClientProxyMockError.generic))
|
||||
@@ -96,9 +106,19 @@ extension ClientProxyMock {
|
||||
|
||||
roomForIdentifierClosure = { [weak self] identifier in
|
||||
if let room = self?.roomSummaryProvider.roomListPublisher.value.first(where: { $0.id == identifier }) {
|
||||
let roomProxy = await JoinedRoomProxyMock(.init(id: room.id, name: room.name))
|
||||
roomProxy.loadOrFetchEventDetailsForReturnValue = .success(TimelineEventSDKMock())
|
||||
return .joined(roomProxy)
|
||||
let joinedRoomIDs = configuration.overrides.joinedRoomIDs
|
||||
switch room.joinRequestType {
|
||||
case .invite where !joinedRoomIDs.contains(room.id):
|
||||
let roomProxy = await InvitedRoomProxyMock(.init(id: room.id, name: room.name, isSpace: room.isSpace))
|
||||
return .invited(roomProxy)
|
||||
case .knock where !joinedRoomIDs.contains(room.id):
|
||||
let roomProxy = await KnockedRoomProxyMock(.init(id: room.id, name: room.name))
|
||||
return .knocked(roomProxy)
|
||||
default:
|
||||
let roomProxy = await JoinedRoomProxyMock(.init(id: room.id, name: room.name, isSpace: room.isSpace))
|
||||
roomProxy.loadOrFetchEventDetailsForReturnValue = .success(TimelineEventSDKMock())
|
||||
return .joined(roomProxy)
|
||||
}
|
||||
} else if let spaceRoomProxy = configuration.spaceServiceConfiguration.joinedSpaces.first(where: { $0.id == identifier }) {
|
||||
let roomProxy = await JoinedRoomProxyMock(.init(id: spaceRoomProxy.id, name: spaceRoomProxy.name, isSpace: spaceRoomProxy.isSpace))
|
||||
roomProxy.loadOrFetchEventDetailsForReturnValue = .success(TimelineEventSDKMock())
|
||||
|
||||
@@ -344,7 +344,7 @@ extension Array where Element == RoomSummary {
|
||||
|
||||
static let mockSpaceInvites: [Element] = [
|
||||
RoomSummary(room: RoomSDKMock(),
|
||||
id: "someAwesomeSpaceID1",
|
||||
id: "!space1:matrix.org",
|
||||
joinRequestType: .invite(inviter: RoomMemberProxyMock.mockCharlie),
|
||||
name: "First space",
|
||||
isDirect: false,
|
||||
@@ -365,7 +365,7 @@ extension Array where Element == RoomSummary {
|
||||
isFavourite: false,
|
||||
isTombstoned: false),
|
||||
RoomSummary(room: RoomSDKMock(),
|
||||
id: "someAwesomeSpaceID2",
|
||||
id: "!space2:matrix.org",
|
||||
joinRequestType: .invite(inviter: RoomMemberProxyMock.mockCharlie),
|
||||
name: "Second space",
|
||||
isDirect: false,
|
||||
|
||||
@@ -22,6 +22,7 @@ enum A11yIdentifiers {
|
||||
static let loginScreen = LoginScreen()
|
||||
static let authenticationStartScreen = AuthenticationStartScreen()
|
||||
static let reportContent = ReportContent()
|
||||
static let joinRoomScreen = JoinRoomScreen()
|
||||
static let roomScreen = RoomScreen()
|
||||
static let roomDetailsScreen = RoomDetailsScreen()
|
||||
static let roomNotificationSettingsScreen = RoomNotificationSettingsScreen()
|
||||
@@ -132,6 +133,10 @@ enum A11yIdentifiers {
|
||||
let ignoreUser = "report_content-ignore_user"
|
||||
}
|
||||
|
||||
struct JoinRoomScreen {
|
||||
let join = "join-room_join"
|
||||
}
|
||||
|
||||
struct RoomScreen {
|
||||
let name = "room-name"
|
||||
let avatar = "room-avatar"
|
||||
|
||||
@@ -53,6 +53,7 @@ struct HomeScreenInviteCell: View {
|
||||
context.send(viewAction: .selectRoom(roomIdentifier: roomID))
|
||||
}
|
||||
}
|
||||
.accessibilityIdentifier(A11yIdentifiers.homeScreen.roomName(room.name))
|
||||
}
|
||||
|
||||
// MARK: - Private
|
||||
|
||||
@@ -78,7 +78,7 @@ struct JoinRoomScreen: View {
|
||||
.multilineTextAlignment(.center)
|
||||
} icon: {
|
||||
if let icon = context.viewState.subtitleIcon {
|
||||
CompoundIcon(icon)
|
||||
CompoundIcon(icon, size: .small, relativeTo: .compound.bodyLG)
|
||||
.foregroundStyle(.compound.iconTertiary)
|
||||
}
|
||||
}
|
||||
@@ -308,6 +308,7 @@ struct JoinRoomScreen: View {
|
||||
var joinButton: some View {
|
||||
Button(L10n.screenJoinRoomJoinAction) { context.send(viewAction: .join) }
|
||||
.buttonStyle(.compound(.super))
|
||||
.accessibilityIdentifier(A11yIdentifiers.joinRoomScreen.join)
|
||||
}
|
||||
|
||||
@ToolbarContentBuilder
|
||||
|
||||
@@ -586,9 +586,14 @@ class MockScreen: Identifiable {
|
||||
appSettings.analyticsConsentState = .optedOut
|
||||
appSettings.hasSeenSpacesAnnouncement = true
|
||||
|
||||
let roomSummaries: [RoomSummary] = if id == .userSessionSpacesFlow {
|
||||
[[RoomSummary].mockSpaceInvites[0]] + .mockRooms
|
||||
} else {
|
||||
.mockRooms
|
||||
}
|
||||
let clientProxy = ClientProxyMock(.init(userID: "@mock:client.com",
|
||||
deviceID: "MOCKCLIENT",
|
||||
roomSummaryProvider: RoomSummaryProviderMock(.init(state: .loaded(.mockRooms))),
|
||||
roomSummaryProvider: RoomSummaryProviderMock(.init(state: .loaded(roomSummaries))),
|
||||
spaceServiceConfiguration: .init(joinedSpaces: .mockSingleRoom),
|
||||
roomPreviews: [SpaceRoomProxyProtocol].mockSpaceList.map(RoomPreviewProxyMock.init)))
|
||||
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:8c7ecdd098726a67b9aa8e3791fe5add49550aecce68a044f8936e916177a862
|
||||
size 155987
|
||||
oid sha256:b64d39063d947cffaaaee3406a16818659a0b4c948ba058a9498f553f811ae1e
|
||||
size 155744
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:042ff14fd2e6731232a2cbeec8e675ff9442d657b8b4b704912ff844af4c3c0f
|
||||
size 159344
|
||||
oid sha256:f7a106e97cc983c90259c2c096ca2df3c8a5452ec0b2877c7c381e12f16e7d3d
|
||||
size 159168
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:db36b1acae44c462d3cdb24e4d6f70d1b70873e71b67661ba0633f0a00492027
|
||||
size 101530
|
||||
oid sha256:e0c74ff1b9b9d4cf69c4fc4e5b96ee11570d45bed37de70a698209ac7b6c09c8
|
||||
size 101461
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:9901c21114602912448b39e77c73c14b0aa23bc2988aad88148798a042322f1d
|
||||
size 104300
|
||||
oid sha256:ebb1ebb3107b0b9dbae9f4de86c48cea196b258ecbb7fd1fb82e09c250d5a522
|
||||
size 104209
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:747566f597d00c4455a8564595bd789496a5ea3d941bb1874d1f948ffd51e47b
|
||||
size 165417
|
||||
oid sha256:c0ee0d4847fb003b252379327d1caa912e35d2b65a72b340045586d8ce0f5627
|
||||
size 165174
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:1153cc719780abdf85c87e3042348ee58ba775a92cd3ba6718f0d922dfd12afc
|
||||
size 180688
|
||||
oid sha256:eeb29b2dab1b9cc438bec029059bc20210ed962b85021262ec4f04f724ceadd1
|
||||
size 180512
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:3d17b79e27230a81bff775d5422ee2f8eab52e73ccdc9d18a90358910f2393a9
|
||||
size 112438
|
||||
oid sha256:1d6a4a7a43bcf9375936969996a2d77de6adc63ed5a88cbdf01250d0cf0dd14a
|
||||
size 112369
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:f3a3d6b60aef4c1dbbb7c1c67de55c6fa7d1c00693ec541e8d77e05ac8bb549c
|
||||
size 128845
|
||||
oid sha256:1690fe94101c7bbc264f0ebd0fe9ff085b96fc6e7743fac3a0bb8aa67d6367e8
|
||||
size 128754
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:e74f12af61e302954661b018141f1e3859ae16f3ffa6fccdc94a5abc3dd428a5
|
||||
size 152924
|
||||
oid sha256:d4532756113bf30ecbfa13f2bc724012af8bf5ebfb11137d85b9de3b64e26e53
|
||||
size 152681
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:6342665e8149cc8a766f3fe0c671d4c366ad6e892c7f2d419c7e172f0c812e02
|
||||
size 157375
|
||||
oid sha256:6e0103582b5e2e68d6dcfe18b778d524d5a8c682e5de6319b04c4b1ba993241f
|
||||
size 157199
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:022ff2f4a913e937afb9681b34b037c03da046388cff32d9d1725e215b6e877e
|
||||
size 98792
|
||||
oid sha256:5d5c7e3d3ba331a97be5fd0b15138d038036917ffbad27cdc167ed234cc0b6b7
|
||||
size 98723
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:05703c21ffd2172f898403ec394a3ef553af746170cf853b340a3847f0b2e509
|
||||
size 106115
|
||||
oid sha256:da01b8365de13dd3c29ff8c7bfc90a482fae5c0023437ca50b3ce556bc316c01
|
||||
size 106024
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:dd0b92b717a60d6164da136abdcc73e9f4f198470237eef388032d8e6f3eaf62
|
||||
size 169860
|
||||
oid sha256:01799147849a30494e90271d86b44705a8e4722c59cdfd753ca8fa18f936e954
|
||||
size 169626
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:e0b7a45889413d8b92a5010cb0cc1f4036099fc73f9f441516ae0f5c1da77677
|
||||
size 177675
|
||||
oid sha256:2011d476a129fc50c403584bd172b659c04d9c00c26c82bedc65724a500086a9
|
||||
size 177496
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:d9a192ba7ecc7ae4e827e34c0affd78f6329f0909006a6ef513a2744d0de6f7a
|
||||
size 115433
|
||||
oid sha256:1b7de77332d26d6673a467ac6a3afe580c562b931c770196227f6c672adf3057
|
||||
size 115333
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:659f50ba9fffc7946108539417926ae814d9573cd3deeafd2b708ab95e4424ec
|
||||
size 122031
|
||||
oid sha256:c47081a2ec8775c5e8b4440bddf970b90dda683811f71a172bc0201012c2fca9
|
||||
size 121941
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:560f8c4deec3fbf1e69c1c1f9f317b1c6257f552c13e896c3b3826d4d1fcc1ac
|
||||
size 136588
|
||||
oid sha256:0ccc9754e57a5a9af82678a76ef51a95ea4d3392717ac5367bbb2876dd2c857a
|
||||
size 136425
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:5b7c10c1fdec19789ff406e23e3d704c40c6507355a1b25453cf7aff6a06b9f9
|
||||
size 144192
|
||||
oid sha256:5ebffe641e6e987fd653aea3190ad74d22cd8542fde4877bdb8a8faed971e223
|
||||
size 144094
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:b0a1c4a336a7b91bc68db1e30f98fc4b83890341b4c2ba7430fddd1fa8c47b91
|
||||
size 83571
|
||||
oid sha256:40c404bbb3fb95424054d740d653e388ea98f4617b76cc16cd83cc1a5ac8301f
|
||||
size 83505
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:bc7cd63464452fe4ef6d3c5c206443b3bab5c2fcd44e8fbda52514cc346282b3
|
||||
size 90250
|
||||
oid sha256:caef2d638fc47f4673a14b7bfb89031ac0b4c92774a1772e61f58e28cdb7516e
|
||||
size 90167
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:df07dd77ff1360eeba59b45845e04c31193e416b6329f5d22d7c4bbac7ed82c4
|
||||
size 153697
|
||||
oid sha256:80824834196518d7c300e6f29a9091adfbd679982096b095d96522999432866d
|
||||
size 153284
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:94cf9ad076fa28d60f91f13c9155e8bbd4a2cbaccce8377acf681e407938fddd
|
||||
size 158014
|
||||
oid sha256:7da0dcdfb9f6d6909fc0d5732c9707eb5abdeebc57de73ca3cd27a01968440da
|
||||
size 157666
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:17839a53a772dc9ea11fe53158ab22ece5de934c43b038f585bbbcbb052428d5
|
||||
size 98605
|
||||
oid sha256:d64249ae140d85d3dfe3db5543dd7614e3ee7f03427f8084dfe17bb9ffa67d6c
|
||||
size 98408
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:db352a19da48dcb17ea6d9f3954fee0121c844f3679837e6d7507aa4756f5aa8
|
||||
size 102225
|
||||
oid sha256:01382e553036cc4736c28f573410a1af8e41f6db6605d87411946c73b134a238
|
||||
size 101851
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:95154e85234a006bc3d9d14fe328b08a952811a1793a63e151109bad87b349a7
|
||||
size 168021
|
||||
oid sha256:0402bac24b9a6aff562986808431c9d46eeea4e4385eb58498b7861e9ad40043
|
||||
size 167776
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:7192b759ef4313b2cfc77f53a1531fce5e462edf864976c3c7cf189344addffb
|
||||
size 174386
|
||||
oid sha256:a2f5439dae1b7e2242840dfe62df04e0e842e9df6ce44c9d37d233eee9b3a3d5
|
||||
size 174220
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:470e52abff20aa595c570e64ff8737a2e66dadb771a4b50f1edf3cb3306d7d68
|
||||
size 110813
|
||||
oid sha256:88f2e75cfb3d44df8c0a16affaf8ef7bb233ade3602a54e624cc5b64d0127790
|
||||
size 110681
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:557083c24102d545756701e8173dcab066c2a3d5a36efca977b3d5ae8542777e
|
||||
size 120751
|
||||
oid sha256:dc09c8492737ff9626f1608c12ba4f5c1bc614b3a54715d48f1485ab5e3e9eb7
|
||||
size 120640
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:c4a206555031475e4d1197f1afdca06f6cfb1b635917324e0b22c19859797ef6
|
||||
size 168948
|
||||
oid sha256:91e3a7c43b4bc6578c1f89c0fc9ffdf6e3a2f2dcc5767279c67b4adeba08bdf5
|
||||
size 168714
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:7b783ede0d576d450fff7f88d6f329bb804c67aa7011d4a6a547ca1441097dd7
|
||||
size 184674
|
||||
oid sha256:bf70a39b7000410c91daa64a74daec73579c18600dbdaefb3431cbf693aabbd5
|
||||
size 184453
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:122a6a1f4e63ab719756f6e068e75d3641368c029a12bcc54d11b0afdb2028e9
|
||||
size 115575
|
||||
oid sha256:e79cb17424bf723249d3fd944dd29a4f3e08ebc4779834dc149f4fd729aa8fc8
|
||||
size 115458
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:13b819e086ff2dfb7d0a307c0076de25dbf87c5ae95ee3180eff3847220ee424
|
||||
size 132796
|
||||
oid sha256:2625d408e4dc11cefd5caac0ca0d57c48a72b7cca74b0077b9d63af919a69ebe
|
||||
size 132510
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:34d003d6e4e2f16d0db1af912a9129eb65cb0314ed020f687c18bb1acb287911
|
||||
size 153881
|
||||
oid sha256:dfad94ee7b211a33b3f2aa791ed5a282e1f20be69097e8d8ef5f3b1cf1cc83e0
|
||||
size 153647
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:23aa5762f066e01e660cb0f299bb82b027adff03fbfc16d77d5f026c68c61c93
|
||||
size 158125
|
||||
oid sha256:93edd0667b60077967d1623ad9ff075622a2f42174bbea6c741f8efe08089b1a
|
||||
size 157904
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:9668f822abf59c1759b13097eb7344ed9dad8f119a89b149696a05ebfafd7873
|
||||
size 98768
|
||||
oid sha256:2d3f26fc00063cb1cfdea96f778a8039d2ed581f31c27123849a4fac2b21a9b9
|
||||
size 98651
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:42daf6c59a042bc6eaf1af8a7b7e501ad5facef1fa0af3ff65e0c451337a5fd3
|
||||
size 102447
|
||||
oid sha256:f06236ffd6153e26116b46af7b5fa9c3d2ef35d1cd03d80b49ab1bcea7d50c66
|
||||
size 102161
|
||||
|
||||
@@ -14,6 +14,7 @@ class UserSessionScreenTests: XCTestCase {
|
||||
let unjoinedSpaceRoomName = "Company Room"
|
||||
let joinedSubspaceName = "Joined Space"
|
||||
let joinedSubspaceRoomName = "Management"
|
||||
let spaceInviteName = "First space"
|
||||
|
||||
enum Step {
|
||||
static let homeScreen = 1
|
||||
@@ -108,4 +109,36 @@ class UserSessionScreenTests: XCTestCase {
|
||||
try await Task.sleep(for: .seconds(1))
|
||||
try await app.assertScreenshot(step: Step.spaceJoinRoomScreen)
|
||||
}
|
||||
|
||||
func testAcceptSpaceInvite() async throws {
|
||||
let app = Application.launch(.userSessionSpacesFlow)
|
||||
|
||||
app.swipeDown() // Make sure the header shows a large title
|
||||
|
||||
try await app.assertScreenshot(step: Step.spacesTabBar)
|
||||
|
||||
// Tap the space invite cell.
|
||||
app.staticTexts[A11yIdentifiers.homeScreen.roomName(spaceInviteName)].tap()
|
||||
XCTAssert(app.buttons[A11yIdentifiers.joinRoomScreen.join].waitForExistence(timeout: 5.0))
|
||||
try await Task.sleep(for: .seconds(1))
|
||||
try await app.assertScreenshot(step: Step.spaceJoinRoomScreen)
|
||||
|
||||
// Tap join on the join room screen.
|
||||
app.buttons[A11yIdentifiers.joinRoomScreen.join].tap()
|
||||
XCTAssert(app.staticTexts[A11yIdentifiers.roomScreen.name].waitForExistence(timeout: 5.0)) // The space screen reuses the room screen header
|
||||
try await Task.sleep(for: .seconds(1))
|
||||
try await app.assertScreenshot(step: Step.spaceScreen)
|
||||
|
||||
// Go back to the room list.
|
||||
app.navigationBars.buttons["Chats"].firstMatch.tap(.center)
|
||||
XCTAssert(app.staticTexts["Chats"].waitForExistence(timeout: 5.0))
|
||||
|
||||
// Tap the join button in the space invite cell.
|
||||
app.buttons.matching(NSPredicate(format: "identifier == %@ && label == %@",
|
||||
A11yIdentifiers.homeScreen.roomName(spaceInviteName),
|
||||
"Accept")).firstMatch.tap()
|
||||
XCTAssert(app.staticTexts[A11yIdentifiers.roomScreen.name].waitForExistence(timeout: 5.0)) // The space screen reuses the room screen header
|
||||
try await Task.sleep(for: .seconds(1))
|
||||
try await app.assertScreenshot(step: Step.spaceScreen)
|
||||
}
|
||||
}
|
||||
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:2846840b9913ac6abd1c7a220424b54939852f0db79b280d6e5cf338246fd3cf
|
||||
size 511246
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:961b37b8f529d2ec7e1963accc1ddbc687e3c01d943fa88aa897f4424c58ad3a
|
||||
size 391645
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:183db1d4451e0b945d955969dbb006ff3444695befecbf00dee12e5d9cb2afcd
|
||||
size 383420
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:663e4307f18242abd11411e24feaa792836fcf6cea8ea5e2b95d4619cc89209f
|
||||
size 607323
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:b8359781830e2974d4e0e25d498d49b9383cfbbaed734a8a5e5bbc2016998a53
|
||||
size 132455
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:9bfb52bac5e3123f2a49ac93bf17fd362e2bb0c84289ce76df77323bc0451406
|
||||
size 123854
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:181f62e6c2d5722aaa087350ff62be9777c79143feb7895e684be6bef139505e
|
||||
size 463906
|
||||
oid sha256:2846840b9913ac6abd1c7a220424b54939852f0db79b280d6e5cf338246fd3cf
|
||||
size 511246
|
||||
|
||||
+2
-2
@@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:1fc6f05c96afa0743d4e9e5be467e26c2abd3817f58b36e662ba4d1bcb7d45ef
|
||||
size 553323
|
||||
oid sha256:663e4307f18242abd11411e24feaa792836fcf6cea8ea5e2b95d4619cc89209f
|
||||
size 607323
|
||||
|
||||
Reference in New Issue
Block a user