Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add iOS 14.2 to snapshot test matrix #52

Merged
merged 7 commits into from
Jan 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,19 @@ jobs:
runs-on: macOS-latest
strategy:
matrix:
platform: ['iOS_13']
platform: ['iOS_14', 'iOS_13']
fail-fast: false
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Bundle Install
run: bundle install --gemfile=Example/Gemfile
- name: Select Xcode Version
- name: Select Xcode Version (12.2)
run: sudo xcode-select --switch /Applications/Xcode_12.2.app/Contents/Developer
if: matrix.platform == 'iOS_14'
- name: Select Xcode Version (11.3.1)
run: sudo xcode-select --switch /Applications/Xcode_11.3.1.app/Contents/Developer
if: matrix.platform == 'iOS_13'
- name: Pod Install
run: bundle exec --gemfile=Example/Gemfile pod install --project-directory=Example
- name: Build and Test
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions Example/SnapshotTests/SnapshotTestCase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class SnapshotTestCase: FBSnapshotTestCase {
// MARK: - Private Static Properties

private static let testedDevices = [
TestDeviceConfig(systemVersion: "14.2", screenSize: CGSize(width: 390, height: 844), screenScale: 3),
TestDeviceConfig(systemVersion: "13.3", screenSize: CGSize(width: 375, height: 812), screenScale: 3),
TestDeviceConfig(systemVersion: "12.1", screenSize: CGSize(width: 375, height: 812), screenScale: 3),
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,17 @@ extension UIView {

public func drawHierarchyWithInvertedColors(in rect: CGRect, using context: UIGraphicsImageRendererContext) {
if accessibilityIgnoresInvertColors {
drawHierarchy(in: rect, afterScreenUpdates: false)
drawHierarchy(in: rect, afterScreenUpdates: true)

} else {
let subviewsToDrawSeparately = subviews.filter { subview in
!subview.isHidden && subview.hasSubviewInHierarchyThatIgnoresInvertColors
}
subviewsToDrawSeparately.forEach { $0.isHidden = true }
CATransaction.flush()

let renderer = UIGraphicsImageRenderer(bounds: bounds)
let image = renderer.image { context in
drawHierarchy(in: bounds, afterScreenUpdates: false)
drawHierarchy(in: bounds, afterScreenUpdates: true)
}

let filter = CIFilter(name: "CIColorInvert")!
Expand All @@ -47,7 +46,6 @@ extension UIView {
context.cgContext.draw(invertedCGImage, in: rect)

subviewsToDrawSeparately.forEach { $0.isHidden = false }
CATransaction.flush()

// Sort the visible subviews by their ordering in the draw stack. For the most part, the
// position of views is determined by the ordering of `subviews`, with the exception of those
Expand Down