Skip to content

Commit

Permalink
test: Add new test to ensure video block is hidden
Browse files Browse the repository at this point in the history
  • Loading branch information
Siobhan committed Feb 27, 2024
1 parent 323f88d commit d9d8d04
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,13 @@ class StringStripGutenbergContentForExcerptTests: XCTestCase {

XCTAssertEqual(summary, expectedSummary)
}

func testStrippingGutenbergContentForExcerptWithVideoPress2() {
let content = "<p>Before</p>\n<!-- wp:video {\"guid\":\"AbCDe\",\"id\":5297} -->\n<figure class=\"wp-block-video\"><div class=\"wp-block-embed__wrapper\">\nhttps://videopress.com/v/AbCDe?resizeToParent=true&amp;cover=true&amp;preloadContent=metadata&amp;useAverageColor=true\n</div></figure>\n<!-- /wp:video -->\n<p>After</p>"
let expectedSummary = "<p>Before</p>\n<p>After</p>"

let summary = content.strippingGutenbergContentForExcerpt()

XCTAssertEqual(summary, expectedSummary)
}
}

0 comments on commit d9d8d04

Please sign in to comment.