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

Allow Enable/Disable Scrolling #42

Merged
merged 8 commits into from
Aug 1, 2019
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
4 changes: 2 additions & 2 deletions Example/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ PODS:
- iOSSnapshotTestCase/Core (4.0.1)
- iOSSnapshotTestCase/SwiftSupport (4.0.1):
- iOSSnapshotTestCase/Core
- WLEmptyState (2.0.0)
- WLEmptyState (3.0.0)

DEPENDENCIES:
- iOSSnapshotTestCase
Expand All @@ -20,7 +20,7 @@ EXTERNAL SOURCES:

SPEC CHECKSUMS:
iOSSnapshotTestCase: f3b2b7e606fe03fdbe49af84316bd235df32dc44
WLEmptyState: 0573edb909655cd6e5e7a367b371a10525dcee5a
WLEmptyState: 5c7cae4cdc57641ff1193338ad601bf4fa2f05ad

PODFILE CHECKSUM: 5fd6a2332b7cd50dfecaf0807164322168c50c78

Expand Down
4 changes: 2 additions & 2 deletions Example/Pods/Local Podspecs/WLEmptyState.podspec.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Example/Pods/Manifest.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 14 additions & 12 deletions Example/Pods/Pods.xcodeproj/project.pbxproj

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

48 changes: 48 additions & 0 deletions Example/Tests/DelegateTests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
//
// DelegateTests.swift
// WLEmptyState_Example
//
// Created by Jorge Ovalle on 8/1/19.
// Copyright © 2019 CocoaPods. All rights reserved.
//

import XCTest
import WLEmptyState

class DelegateTests: XCTestCase {

override func setUp() {
WLEmptyState.configure()
}

// MARK: - UTableView
func testShouldScrollDelegatePropertyOnTableDefault() {
let defaultTableViewController = DefaultTableViewController()

let enableScrollForEmptyState = defaultTableViewController.tableView.emptyStateDelegate?.enableScrollForEmptyState()
XCTAssertEqual(true, enableScrollForEmptyState)
}

func testShouldScrollDelegatePropertyOnTableCustom() {
let customTableViewController = CustomEmptyStateTableViewController()

let enableScrollForEmptyState = customTableViewController.tableView.emptyStateDelegate?.enableScrollForEmptyState()
XCTAssertEqual(false, enableScrollForEmptyState)
}

// MARK: - UICollectionView
func testShouldScrollDelegatePropertyOnCollectionDefault() {
let defaultCollectionViewController = DefaultCollectionViewController(collectionViewLayout: UICollectionViewFlowLayout())

let enableScrollForEmptyState = defaultCollectionViewController.collectionView.emptyStateDelegate?.enableScrollForEmptyState()
XCTAssertEqual(true, enableScrollForEmptyState)
}

func testShouldScrollDelegatePropertyOnCollectionCustom() {
let customCollectionViewController = CustomCollectionViewController(collectionViewLayout: UICollectionViewFlowLayout())

let enableScrollForEmptyState = customCollectionViewController.collectionView.emptyStateDelegate?.enableScrollForEmptyState()
XCTAssertEqual(false, enableScrollForEmptyState)
}

}
Loading