TM-SGNL-iOS/Signal/test/AppDelegateTest.swift
TeleMessage developers dde0620daf initial commit
2025-05-03 12:28:28 -07:00

21 lines
680 B
Swift

//
// Copyright 2022 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
//
import XCTest
@testable import Signal
class AppDelegateTest: XCTestCase {
func testApplicationShortcutItems() throws {
func hasNewMessageShortcut(_ shortcuts: [UIApplicationShortcutItem]) -> Bool {
shortcuts.contains(where: { $0.type.contains("quickCompose") })
}
let unregistered = AppDelegate.applicationShortcutItems(isRegistered: false)
XCTAssertFalse(hasNewMessageShortcut(unregistered))
let registered = AppDelegate.applicationShortcutItems(isRegistered: true)
XCTAssertTrue(hasNewMessageShortcut(registered))
}
}