Skip to content

Commit

Permalink
test emoji and use local image
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbreiding committed Oct 30, 2020
1 parent c76f576 commit 94e8eff
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions packages/desktop-gui/cypress/fixtures/release_notes.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"title": "Check Out This Release",
"title": "Check Out This Release 😀",
"version": "1.2.3",
"bannerImage": "https://placekitten.com/1000/200",
"content": "<h1>This is a great release</h1><h2>dolor sit amet</h2><h3>consectetur adipiscing elit</h3><h4>sed do eiusmod </h4><h5>tempor incididunt</h5><h6>ut labore et</h6><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod \ntempor incididunt ut labore et dolore magna aliqua. </p><ul><li><p><b>bold</b> text</p></li><li><p><i>italic</i> text</p><ul><li><p><a href=\"https://placekitten.com/1000/200\">link</a><u></u></p></li><li><p><u>underlined</u> text</p></li></ul></li></ul><ul><li><p>some <code>code</code> here</p></li></ul><ol><li><p>one</p></li><li><p>two</p><ol><li><p>aaay</p></li><li><p>beee</p></li></ol></li><li><p>three</p></li></ol><blockquote><p>Here&#39;s a blockquote</p></blockquote><hr/><p>Duis aute irure dolor in <a href=\"https://placekitten.com/1000/200\">reprehenderit</a> in voluptate \nvelit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint \noccaecat cupidatat non proident, sunt in culpa qui officia deserunt \nmollit anim id est laborum.</p><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod \ntempor incididunt ut labore et dolore magna aliqua. </p><p></p>",
"bannerImage": "cypress-banner.jpg",
"content": "<h1>This is a great release</h1><h2>dolor sit amet 😀 4️⃣ 👽 👍 🌎</h2><h3>consectetur adipiscing elit</h3><h4>sed do eiusmod </h4><h5>tempor incididunt</h5><h6>ut labore et</h6><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod \ntempor incididunt ut labore et dolore magna aliqua. </p><ul><li><p><b>bold</b> text</p></li><li><p><i>italic</i> text</p><ul><li><p><a href=\"https://example.com/link-one\">link</a><u></u></p></li><li><p><u>underlined</u> text</p></li></ul></li></ul><ul><li><p>some <code>code</code> here</p></li></ul><ol><li><p>one</p></li><li><p>two</p><ol><li><p>aaay</p></li><li><p>beee</p></li></ol></li><li><p>three</p></li></ol><blockquote><p>Here&#39;s a blockquote</p></blockquote><hr/><p>Duis aute irure dolor in <a href=\"https://example.com/link-two\">reprehenderit</a> in voluptate \nvelit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint \noccaecat cupidatat non proident, sunt in culpa qui officia deserunt \nmollit anim id est laborum.</p><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod \ntempor incididunt ut labore et dolore magna aliqua. </p><p></p>",
"externalLink": "https://example.com",
"externalLinkText": "Check out this blog post for more information"
"externalLinkText": "Check out this blog post for more information 👍"
}
19 changes: 18 additions & 1 deletion packages/desktop-gui/cypress/integration/release_notes_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ describe('Release Notes', () => {

cy.fixture('user').then((theUser) => user = theUser)
cy.fixture('release_notes').then((theReleaseNotes) => releaseNotes = theReleaseNotes)
cy.route2('cypress-banner.jpg', { fixture: 'cypress-banner.jpg' })

cy.visitIndex().then((win) => {
ipc = win.App.ipc
Expand Down Expand Up @@ -58,8 +59,12 @@ describe('Release Notes', () => {
cy.contains(releaseNotes.title)
})

it('title handles emoji', () => {
cy.get('.release-notes h4').should('include.text', '😀')
})

it('shows banner image', () => {
cy.get('.release-notes img').should('have.attr', 'src', 'https://placekitten.com/1000/200')
cy.get('.release-notes img').should('have.attr', 'src', releaseNotes.bannerImage)
cy.get('.release-notes img').should('have.attr', 'width', '548')
})

Expand All @@ -70,6 +75,13 @@ describe('Release Notes', () => {
.should('have.text', 'This is a great release')
})

it('content handles emoji', () => {
cy.get('.release-notes .contents')
.shadow()
.find('h2')
.should('include.text', '😀 4️⃣ 👽 👍 🌎')
})

it('opens links in content externally', () => {
cy.get('.release-notes .contents')
.shadow()
Expand Down Expand Up @@ -99,6 +111,11 @@ describe('Release Notes', () => {
.should('have.text', releaseNotes.externalLinkText)
})

it('external link text handles emoji', () => {
cy.get('.release-notes .external-link')
.should('include.text', '👍')
})

it('opens external link externally', () => {
cy.get('.release-notes .external-link').click().then(() => {
expect(ipc.externalOpen).to.be.calledWith(releaseNotes.externalLink)
Expand Down

0 comments on commit 94e8eff

Please sign in to comment.