Skip to content

Commit

Permalink
Add Markdown snapshot tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gonzalezreal committed Jan 3, 2021
1 parent 7e67742 commit 721b1f0
Show file tree
Hide file tree
Showing 140 changed files with 352 additions and 2,320 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"repositoryURL": "https://github.com/gonzalezreal/AttributedText",
"state": {
"branch": null,
"revision": "9e72b40cd0faaaff66df7b3594464655f2fb5c99",
"version": "0.1.4"
"revision": "3e51554aa56372b2d5a82a061abb06a2691f93b8",
"version": "0.2.0"
}
},
{
Expand All @@ -30,11 +30,11 @@
},
{
"package": "cmark",
"repositoryURL": "https://github.com/apple/swift-cmark",
"repositoryURL": "https://github.com/SwiftDocOrg/swift-cmark.git",
"state": {
"branch": null,
"revision": "9c8096a23f44794bde297452d87c455fc4f76d42",
"version": null
"revision": "1168665f6b36be747ffe6b7b90bc54cfc17f42b7",
"version": "0.28.3+20200207.1168665"
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ test:
xcodebuild test \
-scheme MarkdownUI-Package \
-destination '$(DESTINATION_MAC)'
xcodebuild test \
xcodebuild \
-scheme MarkdownUI-Package \
-destination '$(DESTINATION_CATALYST)'
xcodebuild test \
Expand Down
4 changes: 2 additions & 2 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"repositoryURL": "https://github.com/gonzalezreal/AttributedText",
"state": {
"branch": null,
"revision": "6f889a35d2b2324227b1b5ecc1d10d3c85a8fc3d",
"version": "0.1.6"
"revision": "3e51554aa56372b2d5a82a061abb06a2691f93b8",
"version": "0.2.0"
}
},
{
Expand Down
7 changes: 2 additions & 5 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ let package = Package(
.package(
name: "AttributedText",
url: "https://github.com/gonzalezreal/AttributedText",
from: "0.1.6"
from: "0.2.0"
),
.package(
name: "NetworkImage",
Expand Down Expand Up @@ -74,10 +74,7 @@ let package = Package(
"MarkdownUI",
"SnapshotTesting",
],
exclude: [
"__Fixtures__",
"__Snapshots__",
]
exclude: ["__Snapshots__"]
),
]
)
9 changes: 3 additions & 6 deletions Sources/MarkdownUI/Shared/MarkdownStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,17 @@

self.document = document
self.environment = environment
updateAttributedText()
renderAttributedText()
}

func onEnvironmentChange(_ environment: Environment) {
guard self.environment != environment else { return }

self.environment = environment
updateAttributedText()
renderAttributedText()
}
}

@available(macOS 10.15, iOS 13.0, tvOS 13.0, *)
private extension MarkdownStore {
func updateAttributedText() {
private func renderAttributedText() {
guard let document = self.document, let environment = self.environment else {
attributedText = NSAttributedString()
return
Expand Down
Loading

0 comments on commit 721b1f0

Please sign in to comment.