diff --git a/Charts/Cartfile.resolved b/Charts/Cartfile.resolved index 7a9e34bf6b..5c0aaea234 100644 --- a/Charts/Cartfile.resolved +++ b/Charts/Cartfile.resolved @@ -1 +1 @@ -github "facebook/ios-snapshot-test-case" "2.0.5" +github "facebook/ios-snapshot-test-case" "2.0.7" diff --git a/Charts/Carthage/Checkouts/ios-snapshot-test-case/CHANGELOG.md b/Charts/Carthage/Checkouts/ios-snapshot-test-case/CHANGELOG.md index 39a6b6aaa3..8d3bbf716f 100644 --- a/Charts/Carthage/Checkouts/ios-snapshot-test-case/CHANGELOG.md +++ b/Charts/Carthage/Checkouts/ios-snapshot-test-case/CHANGELOG.md @@ -2,6 +2,14 @@ All notable changes to this project will be documented in this file. +## 2.0.7 + + - Change FBSnapshotTestController from private to public (#129) + +## 2.0.6 + + - Added modulemap and podspec fixes to build with Xcode 7.1 (#127) + ## 2.0.5 - Swift 2.0 (#111, #120) (Thanks to @pietbrauer and @grantjk) @@ -33,14 +41,10 @@ All notable changes to this project will be documented in this file. ## 1.8.1 -### Fixed - - Prevent mangling of C function names when compiled with a C++ compiler. (#79) ## 1.8.0 -### Changed - - The default directories for snapshots images are now **ReferenceImages_32** (32bit) and **ReferenceImages_64** (64bit) and the suffix depends on the architecture when the test is running. (#77) - If a test fails for a given suffix, it will try to load and compare all other suffixes before failing. - Added assertion on setRecordMode. (#76) diff --git a/Charts/Carthage/Checkouts/ios-snapshot-test-case/FBSnapshotTestCase.podspec b/Charts/Carthage/Checkouts/ios-snapshot-test-case/FBSnapshotTestCase.podspec index a630916759..bb650540b7 100644 --- a/Charts/Carthage/Checkouts/ios-snapshot-test-case/FBSnapshotTestCase.podspec +++ b/Charts/Carthage/Checkouts/ios-snapshot-test-case/FBSnapshotTestCase.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "FBSnapshotTestCase" - s.version = "2.0.5" + s.version = "2.0.7" s.summary = "Snapshot view unit tests for iOS" s.description = <<-DESC A "snapshot test case" takes a configured UIView or CALayer @@ -16,13 +16,14 @@ Pod::Spec.new do |s| :tag => s.version.to_s } s.platform = :ios, '7.0' s.requires_arc = true - s.framework = 'XCTest' + s.frameworks = 'XCTest','UIKit','Foundation','QuartzCore' s.pod_target_xcconfig = { 'ENABLE_BITCODE' => 'NO' } - s.public_header_files = ['FBSnapshotTestCase/FBSnapshotTestCase.h', 'FBSnapshotTestCase/FBSnapshotTestCasePlatform.h'] - s.private_header_files = ['FBSnapshotTestCase/FBSnapshotTestController.h', 'FBSnapshotTestCase/UIImage+Compare.h', 'FBSnapshotTestCase/UIImage+Diff.h'] s.default_subspecs = 'SwiftSupport' + s.module_map = 'FBSnapshotTestCase.modulemap' s.subspec 'Core' do |cs| - cs.source_files = 'FBSnapshotTestCase/**/*.{h,m}' + cs.source_files = 'FBSnapshotTestCase/**/*.{h,m}', 'FBSnapshotTestCase/*.{h,m}' + cs.public_header_files = 'FBSnapshotTestCase/FBSnapshotTestCase.h','FBSnapshotTestCase/FBSnapshotTestCasePlatform.h','FBSnapshotTestCase/FBSnapshotTestController.h' + cs.private_header_files = 'FBSnapshotTestCase/Categories/UIImage+Compare.h','FBSnapshotTestCase/Categories/UIImage+Diff.h','FBSnapshotTestCase/Categories/UIImage+Snapshot.h' end s.subspec 'SwiftSupport' do |cs| cs.dependency 'FBSnapshotTestCase/Core' diff --git a/Charts/Carthage/Checkouts/ios-snapshot-test-case/FBSnapshotTestCaseDemo/Podfile.lock b/Charts/Carthage/Checkouts/ios-snapshot-test-case/FBSnapshotTestCaseDemo/Podfile.lock index 4a7002581f..846e4c74af 100644 --- a/Charts/Carthage/Checkouts/ios-snapshot-test-case/FBSnapshotTestCaseDemo/Podfile.lock +++ b/Charts/Carthage/Checkouts/ios-snapshot-test-case/FBSnapshotTestCaseDemo/Podfile.lock @@ -1,8 +1,8 @@ PODS: - - FBSnapshotTestCase (2.0.5): - - FBSnapshotTestCase/SwiftSupport (= 2.0.5) - - FBSnapshotTestCase/Core (2.0.5) - - FBSnapshotTestCase/SwiftSupport (2.0.5): + - FBSnapshotTestCase (2.0.6): + - FBSnapshotTestCase/SwiftSupport (= 2.0.6) + - FBSnapshotTestCase/Core (2.0.6) + - FBSnapshotTestCase/SwiftSupport (2.0.6): - FBSnapshotTestCase/Core DEPENDENCIES: @@ -13,6 +13,6 @@ EXTERNAL SOURCES: :path: ".." SPEC CHECKSUMS: - FBSnapshotTestCase: 6917deb01d0556dd544536f9eb34e0cf26f904d5 + FBSnapshotTestCase: f53793e19b2782f2948e8597b03ec2bb5aedf5cd COCOAPODS: 0.39.0 diff --git a/Charts/Charts.xcodeproj/project.pbxproj b/Charts/Charts.xcodeproj/project.pbxproj index 4790433161..d5edd1a8fd 100644 --- a/Charts/Charts.xcodeproj/project.pbxproj +++ b/Charts/Charts.xcodeproj/project.pbxproj @@ -194,6 +194,7 @@ A52C5C8D1BAC5D1200594CDD /* ChartTransformerHorizontalBarChart.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5BB6EC1C1ACC28AB006E9C25 /* ChartTransformerHorizontalBarChart.swift */; }; A52C5C8E1BAC5D1200594CDD /* ChartUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5BA8EC7C1A9D151C00CE82E1 /* ChartUtils.swift */; }; A52C5C8F1BAC5D1200594CDD /* ChartViewPortHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5BD8F06C1AB897D500566E05 /* ChartViewPortHandler.swift */; }; + DDC77DC61C0A991A00C27BCF /* BarChartTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDC77DC51C0A991A00C27BCF /* BarChartTests.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -319,6 +320,7 @@ 5BD4C57B1BCDBF6C00462351 /* ScatterChartDataProvider.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ScatterChartDataProvider.swift; sourceTree = ""; }; 5BD8F06C1AB897D500566E05 /* ChartViewPortHandler.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ChartViewPortHandler.swift; sourceTree = ""; }; A52C5C371BAC5CA400594CDD /* Charts.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Charts.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + DDC77DC51C0A991A00C27BCF /* BarChartTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BarChartTests.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -350,6 +352,7 @@ 06AEE7A31BDC3F8B009875AE /* ChartsTests */ = { isa = PBXGroup; children = ( + DDC77DC51C0A991A00C27BCF /* BarChartTests.swift */, 06AEE7AD1BDC3FC6009875AE /* LineChartTests.swift */, 06AEE7A61BDC3F8B009875AE /* Info.plist */, ); @@ -719,6 +722,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + DDC77DC61C0A991A00C27BCF /* BarChartTests.swift in Sources */, 06AEE7AE1BDC3FC6009875AE /* LineChartTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/Charts/ChartsTests/BarChartTests.swift b/Charts/ChartsTests/BarChartTests.swift new file mode 100644 index 0000000000..1abef08792 --- /dev/null +++ b/Charts/ChartsTests/BarChartTests.swift @@ -0,0 +1,78 @@ +import XCTest +import FBSnapshotTestCase +@testable import Charts + +class BarChartTests: FBSnapshotTestCase +{ + + var chart: BarChartView! + var dataSet: BarChartDataSet! + + override func setUp() + { + super.setUp() + + // Set to `true` to re-capture all snapshots + self.recordMode = false + + // Sample data + let values: [Double] = [8, 104, 81, 93, 52, 44, 97, 101, 75, 28, + 76, 25, 20, 13, 52, 44, 57, 23, 45, 91, + 99, 14, 84, 48, 40, 71, 106, 41, 45, 61] + + var entries: [ChartDataEntry] = Array() + var xValues: [String] = Array() + + for (i, value) in values.enumerate() + { + entries.append(BarChartDataEntry.init(value: value, xIndex: i)) + xValues.append("\(i)") + } + + dataSet = BarChartDataSet(yVals: entries, label: "Bar chart unit test data") + + chart = BarChartView(frame: CGRectMake(0, 0, 480, 350)) + chart.data = BarChartData(xVals: xValues, dataSet: dataSet) + } + + override func tearDown() + { + // Put teardown code here. This method is called after the invocation of each test method in the class. + super.tearDown() + } + + func testDefaultValues() + { + FBSnapshotVerifyView(chart) + } + + func testHidesValues() + { + dataSet.drawValuesEnabled = false + FBSnapshotVerifyView(chart) + } + + func testHideLeftAxis() + { + chart.leftAxis.drawAxisLineEnabled = false + FBSnapshotVerifyView(chart) + } + + func testHideRightAxis() + { + chart.rightAxis.drawAxisLineEnabled = false + FBSnapshotVerifyView(chart) + } + + func testHideLeftAxisGridlines() + { + chart.leftAxis.drawGridLinesEnabled = false + FBSnapshotVerifyView(chart) + } + + func testHideRightAxisGridlines() + { + chart.rightAxis.drawGridLinesEnabled = false + FBSnapshotVerifyView(chart) + } +} diff --git a/Charts/ChartsTests/ReferenceImages_64/ChartsTests.BarChartTests/testDefaultValues@2x.png b/Charts/ChartsTests/ReferenceImages_64/ChartsTests.BarChartTests/testDefaultValues@2x.png new file mode 100644 index 0000000000..1d79e4a8ce Binary files /dev/null and b/Charts/ChartsTests/ReferenceImages_64/ChartsTests.BarChartTests/testDefaultValues@2x.png differ diff --git a/Charts/ChartsTests/ReferenceImages_64/ChartsTests.BarChartTests/testHideLeftAxis@2x.png b/Charts/ChartsTests/ReferenceImages_64/ChartsTests.BarChartTests/testHideLeftAxis@2x.png new file mode 100644 index 0000000000..6b8ce5f1b9 Binary files /dev/null and b/Charts/ChartsTests/ReferenceImages_64/ChartsTests.BarChartTests/testHideLeftAxis@2x.png differ diff --git a/Charts/ChartsTests/ReferenceImages_64/ChartsTests.BarChartTests/testHideLeftAxisGridlines@2x.png b/Charts/ChartsTests/ReferenceImages_64/ChartsTests.BarChartTests/testHideLeftAxisGridlines@2x.png new file mode 100644 index 0000000000..897d33df75 Binary files /dev/null and b/Charts/ChartsTests/ReferenceImages_64/ChartsTests.BarChartTests/testHideLeftAxisGridlines@2x.png differ diff --git a/Charts/ChartsTests/ReferenceImages_64/ChartsTests.BarChartTests/testHideRightAxis@2x.png b/Charts/ChartsTests/ReferenceImages_64/ChartsTests.BarChartTests/testHideRightAxis@2x.png new file mode 100644 index 0000000000..02342fc16f Binary files /dev/null and b/Charts/ChartsTests/ReferenceImages_64/ChartsTests.BarChartTests/testHideRightAxis@2x.png differ diff --git a/Charts/ChartsTests/ReferenceImages_64/ChartsTests.BarChartTests/testHideRightAxisGridlines@2x.png b/Charts/ChartsTests/ReferenceImages_64/ChartsTests.BarChartTests/testHideRightAxisGridlines@2x.png new file mode 100644 index 0000000000..897d33df75 Binary files /dev/null and b/Charts/ChartsTests/ReferenceImages_64/ChartsTests.BarChartTests/testHideRightAxisGridlines@2x.png differ diff --git a/Charts/ChartsTests/ReferenceImages_64/ChartsTests.BarChartTests/testHidesValues@2x.png b/Charts/ChartsTests/ReferenceImages_64/ChartsTests.BarChartTests/testHidesValues@2x.png new file mode 100644 index 0000000000..f538677da7 Binary files /dev/null and b/Charts/ChartsTests/ReferenceImages_64/ChartsTests.BarChartTests/testHidesValues@2x.png differ