-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support additional layout options in ListAppearance. Update tests to …
…utilize snapshot tests.
- Loading branch information
Showing
10 changed files
with
280 additions
and
85 deletions.
There are no files selected for viewing
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
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
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
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
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
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
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,35 @@ | ||
// | ||
// LayoutAttributesSnapshot.swift | ||
// Listable | ||
// | ||
// Created by Kyle Van Essen on 6/11/20. | ||
// | ||
|
||
import Foundation | ||
import Snapshot | ||
@testable import Listable | ||
|
||
|
||
struct LayoutAttributesSnapshot : SnapshotOutputFormat | ||
{ | ||
typealias RenderingFormat = ListView | ||
|
||
static func snapshotData(with renderingFormat: ListView) throws -> Data { | ||
renderingFormat.layout.layout.content.layoutAttributes.stringRepresentation.data(using: .utf8)! | ||
} | ||
|
||
static var outputInfo: SnapshotOutputInfo { | ||
SnapshotOutputInfo( | ||
directoryName: "ListAttributes", | ||
fileExtension: "txt" | ||
) | ||
} | ||
|
||
static func validate(render: ListView, existingData: Data) throws { | ||
let new = try Self.snapshotData(with: render) | ||
|
||
if new != existingData { | ||
throw SnapshotValidationError.notMatching | ||
} | ||
} | ||
} |
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
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 |
---|---|---|
|
@@ -52,4 +52,4 @@ SPEC CHECKSUMS: | |
|
||
PODFILE CHECKSUM: ede5b0b1b0dfe04b49195609ea6bccb6b577e01f | ||
|
||
COCOAPODS: 1.8.4 | ||
COCOAPODS: 1.9.3 |