-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add AppearanceProxyHelper unit tests
- Loading branch information
Showing
1 changed file
with
51 additions
and
0 deletions.
There are no files selected for viewing
51 changes: 51 additions & 0 deletions
51
SWDestinyTradesTests/Appearance/AppearanceProxyHelperTests.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// | ||
// AppearanceProxyHelperTests.swift | ||
// SWDestinyTradesTests | ||
// | ||
// Created by Diogo Autilio on 20/04/24. | ||
// Copyright © 2024 Diogo Autilio. All rights reserved. | ||
// | ||
|
||
import UIKit | ||
import XCTest | ||
|
||
@testable import SWDestinyTrades | ||
|
||
final class AppearanceProxyHelperTests: XCTestCase { | ||
|
||
func test_customize_tabBar() { | ||
AppearanceProxyHelper.customizeTabBar() | ||
|
||
let tabBarAppearance = UITabBar.appearance() | ||
XCTAssertEqual(tabBarAppearance.tintColor, .white) | ||
XCTAssertEqual(tabBarAppearance.barTintColor, ColorPalette.appTheme) | ||
|
||
if #available(iOS 15.0, *) { | ||
let tabBarScrollEdgeAppearance = UITabBar.appearance(whenContainedInInstancesOf: [UITabBarController.self]).scrollEdgeAppearance | ||
XCTAssertEqual(tabBarScrollEdgeAppearance?.backgroundColor, ColorPalette.appTheme) | ||
} | ||
} | ||
|
||
func test_customize_UITableView() { | ||
AppearanceProxyHelper.customizeUITableView() | ||
|
||
if #available(iOS 15.0, *) { | ||
XCTAssertEqual(UITableView.appearance().sectionHeaderTopPadding, .zero) | ||
} | ||
} | ||
|
||
func test_customize_navigationBar() { | ||
AppearanceProxyHelper.customizeNavigationBar() | ||
|
||
if #available(iOS 13.0, *) { | ||
let standardAppearance = UINavigationBar.appearance(whenContainedInInstancesOf: [UINavigationController.self]).standardAppearance | ||
XCTAssertEqual(standardAppearance.backgroundColor, ColorPalette.appThemeV2) | ||
|
||
let scrollEdgeAppearance = UINavigationBar.appearance(whenContainedInInstancesOf: [UINavigationController.self]).scrollEdgeAppearance | ||
XCTAssertEqual(scrollEdgeAppearance?.backgroundColor, ColorPalette.appThemeV2) | ||
|
||
XCTAssertTrue(UINavigationBar.appearance().prefersLargeTitles) | ||
XCTAssertEqual(UINavigationBar.appearance().tintColor, .white) | ||
} | ||
} | ||
} |