Skip to content

Commit

Permalink
Tries to fix custom folder tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dchohfi committed Mar 31, 2023
1 parent 61dd0c6 commit 3fb008d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
2 changes: 2 additions & 0 deletions Bootstrap/Bootstrap.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
5EFDC7711F8699AA001453EC /* DynamicSizeTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5EFDC76E1F8699AA001453EC /* DynamicSizeTests.swift */; };
5EFDC7721F8699AA001453EC /* DynamicTypeTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5EFDC76F1F8699AA001453EC /* DynamicTypeTests.swift */; };
69BE287EA35A14E2787AC4AF /* Pods_Bootstrap_BootstrapTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CF2E7C50C1B84B73173ED6F7 /* Pods_Bootstrap_BootstrapTests.framework */; };
C31D2DD929D73AFE002BD84C /* BootstrapCustomFolderTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5EFDC7761F8699F9001453EC /* BootstrapCustomFolderTests.swift */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -358,6 +359,7 @@
files = (
5EFDC7701F8699AA001453EC /* WithoutQuickTests.swift in Sources */,
5EFDC7711F8699AA001453EC /* DynamicSizeTests.swift in Sources */,
C31D2DD929D73AFE002BD84C /* BootstrapCustomFolderTests.swift in Sources */,
5EFDC7611F8698B4001453EC /* BootstrapTests.swift in Sources */,
5EFDC7721F8699AA001453EC /* DynamicTypeTests.swift in Sources */,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,31 @@ final class BootstrapCustomFormatTests: QuickSpec {
beforeEach {
setNimbleTestFolder("CustomFolder")
view = UIView(frame: CGRect(origin: .zero, size: CGSize(width: 44, height: 44)))
view.backgroundColor = .blue
view.backgroundColor = UIColor { traits -> UIColor in
if traits.userInterfaceStyle == .dark {
return .brown
} else {
return .blue
}
}
}

it("fails to find the snapshots due to the custom folder") {
expect(view).notTo(haveValidSnapshot(named: "something custom", userInterfaceStyle: .dark))
expect(view).notTo(haveValidSnapshot(named: "something custom", userInterfaceStyle: .light))
expect(view).notTo(haveValidSnapshot(named: "something custom"))
expect(view).notTo(haveValidSnapshot(named: "something custom"))
}

it("finds the snapshots using a custom images directory") {
expect(view).to(haveValidSnapshot())
expect(view).to(recordSnapshot())
}

it("finds device agnostic snapshots with custom images directory") {
expect(view).to(haveValidDeviceAgnosticSnapshot())
expect(view).to(recordDeviceAgnosticSnapshot())
}

it("find the snapshot using a custom image directory for light and dark mode") {
expect(view).to(recordSnapshot(userInterfaceStyle: .light))
expect(view).to(recordSnapshot(userInterfaceStyle: .dark))
}
}
}
Expand Down
Empty file.

0 comments on commit 3fb008d

Please sign in to comment.