ports/devel/electron4/files/patch-electron_spec_api-clipboard-spec.js
Luca Pizzamiglio 2f40d531c4 devel/electron4: Add electron 4.2.2
Finally, after a long wait, an electron port for FreeBSD lands in the
portstree.

A huge thanks to everyone contributed to this huge effort and to the
maintainer that is willing to take the burden of the maintainership!
2019-05-28 09:12:02 +00:00

38 lines
2.3 KiB
JavaScript

--- electron/spec/api-clipboard-spec.js.orig 2019-05-16 05:23:55 UTC
+++ electron/spec/api-clipboard-spec.js
@@ -27,7 +27,7 @@ describe('clipboard module', () => {
describe('clipboard.readHTML()', () => {
it('returns markup correctly', () => {
const text = '<string>Hi</string>'
- const markup = process.platform === 'darwin' ? "<meta charset='utf-8'><string>Hi</string>" : process.platform === 'linux' ? '<meta http-equiv="content-type" ' + 'content="text/html; charset=utf-8"><string>Hi</string>' : '<string>Hi</string>'
+ const markup = process.platform === 'darwin' ? "<meta charset='utf-8'><string>Hi</string>" : (process.platform === 'linux' || process.platform === 'freebsd') ? '<meta http-equiv="content-type" ' + 'content="text/html; charset=utf-8"><string>Hi</string>' : '<string>Hi</string>'
clipboard.writeHTML(text)
expect(clipboard.readHTML()).to.equal(markup)
})
@@ -43,7 +43,7 @@ describe('clipboard module', () => {
describe('clipboard.readBookmark', () => {
before(function () {
- if (process.platform === 'linux') {
+ if (process.platform === 'linux' || process.platform === 'freebsd') {
this.skip()
}
})
@@ -69,7 +69,7 @@ describe('clipboard module', () => {
const rtf = '{\\rtf1\\utf8 text}'
const p = path.join(fixtures, 'assets', 'logo.png')
const i = nativeImage.createFromPath(p)
- const markup = process.platform === 'darwin' ? "<meta charset='utf-8'><b>Hi</b>" : process.platform === 'linux' ? '<meta http-equiv="content-type" ' + 'content="text/html; charset=utf-8"><b>Hi</b>' : '<b>Hi</b>'
+ const markup = process.platform === 'darwin' ? "<meta charset='utf-8'><b>Hi</b>" : (process.platform === 'linux' || process.platform === 'freebsd') ? '<meta http-equiv="content-type" ' + 'content="text/html; charset=utf-8"><b>Hi</b>' : '<b>Hi</b>'
const bookmark = { title: 'a title', url: 'test' }
clipboard.write({
text: 'test',
@@ -84,7 +84,7 @@ describe('clipboard module', () => {
expect(clipboard.readRTF()).to.equal(rtf)
expect(clipboard.readImage().toDataURL()).to.equal(i.toDataURL())
- if (process.platform !== 'linux') {
+ if (process.platform !== 'linux' && process.platform !== 'freebsd') {
expect(clipboard.readBookmark()).to.deep.equal(bookmark)
}
})