mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
spec: clipboard.readImage()
This commit is contained in:
@@ -1,7 +1,18 @@
|
||||
assert = require 'assert'
|
||||
clipboard = require 'clipboard'
|
||||
nativeImage = require 'native-image'
|
||||
path = require 'path'
|
||||
|
||||
describe 'clipboard module', ->
|
||||
fixtures = path.resolve __dirname, 'fixtures'
|
||||
|
||||
describe 'clipboard.readImage()', ->
|
||||
it 'returns NativeImage intance', ->
|
||||
p = path.join fixtures, 'assets', 'logo.png'
|
||||
i = nativeImage.createFromPath p
|
||||
clipboard.writeImage p
|
||||
assert.equal clipboard.readImage().toDataUrl(), i.toDataUrl()
|
||||
|
||||
describe 'clipboard.readText()', ->
|
||||
it 'returns unicode string correctly', ->
|
||||
text = '千江有水千江月,万里无云万里天'
|
||||
|
||||
Reference in New Issue
Block a user