Add spec for 1x1 PNG data URL
This commit is contained in:
parent
b46e48cae1
commit
8eaf48e552
2 changed files with 5 additions and 0 deletions
|
@ -80,6 +80,11 @@ describe('nativeImage module', () => {
|
|||
})
|
||||
|
||||
describe('toDataURL()', () => {
|
||||
it('returns a PNG data URL', () => {
|
||||
const imageA = nativeImage.createFromPath(path.join(__dirname, 'fixtures', 'assets', '1x1.png'))
|
||||
assert.equal(imageA.toDataURL(), 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYlWNgAAIAAAUAAdafFs0AAAAASUVORK5CYII=')
|
||||
})
|
||||
|
||||
it('returns a data URL at 1x scale factor', () => {
|
||||
const imageA = nativeImage.createFromPath(path.join(__dirname, 'fixtures', 'assets', 'logo.png'))
|
||||
const imageB = nativeImage.createFromBuffer(imageA.toPNG(), {
|
||||
|
|
BIN
spec/fixtures/assets/1x1.png
vendored
Normal file
BIN
spec/fixtures/assets/1x1.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 68 B |
Loading…
Add table
Add a link
Reference in a new issue