2023-04-14 12:49:57 +02:00
|
|
|
//
|
|
|
|
// Copyright 2022 New Vector Ltd
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
// You may obtain a copy of the License at
|
|
|
|
//
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
//
|
|
|
|
|
|
|
|
import XCTest
|
|
|
|
|
2023-05-15 15:42:40 +02:00
|
|
|
@MainActor
|
2023-04-14 12:49:57 +02:00
|
|
|
class InvitesScreenUITests: XCTestCase {
|
2023-05-15 15:42:40 +02:00
|
|
|
func testInvitesWithNoBadges() async throws {
|
2023-04-14 12:49:57 +02:00
|
|
|
let app = Application.launch(.invites)
|
2023-05-15 15:42:40 +02:00
|
|
|
try await app.assertScreenshot(.invites)
|
2023-04-14 12:49:57 +02:00
|
|
|
}
|
|
|
|
|
2023-05-15 15:42:40 +02:00
|
|
|
func testDeclineInvite() async throws {
|
2023-04-19 17:05:24 +02:00
|
|
|
let app = Application.launch(.invites)
|
|
|
|
let declineButton = app.buttons[A11yIdentifiers.invitesScreen.decline].firstMatch
|
|
|
|
XCTAssert(declineButton.exists)
|
|
|
|
declineButton.tap()
|
|
|
|
XCTAssertEqual(app.alerts.count, 1)
|
2023-05-15 15:42:40 +02:00
|
|
|
try await app.assertScreenshot(.invites, step: 1)
|
2023-04-19 17:05:24 +02:00
|
|
|
}
|
2023-04-14 12:49:57 +02:00
|
|
|
}
|