Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit fec6b30

Browse files
author
maralv
committed
✅ Add automated tests for base64 encoded images.
The example image is a base64 encoded, fully transparent 1x1 GIF pixel.
1 parent 3ca713f commit fec6b30

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

spec/fixtures/package-with-readme/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ I am a Readme!
66

77
![AbsoluteImage](https://example.com/static/image.jpg)
88
![RelativeImage](static/image.jpg)
9+
![Base64Image](data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==)
910

1011
<script>alert('oh, hai');</script>
1112
<iframe src="https://atom.io"></iframe>

spec/package-detail-view-spec.coffee

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ describe "PackageDetailView", ->
9393
expect(view.element.querySelectorAll('.package-readme input[type="checkbox"][disabled]').length).toBe(2)
9494
expect(view.element.querySelector('img[alt="AbsoluteImage"]').getAttribute('src')).toBe('https://example.com/static/image.jpg')
9595
expect(view.element.querySelector('img[alt="RelativeImage"]').getAttribute('src')).toBe('https://github.com/example/package-with-readme/blob/master/static/image.jpg')
96+
expect(view.element.querySelector('img[alt="Base64Image"]').getAttribute('src')).toBe('data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==')
9697

9798
it "renders the README when the package path is undefined", ->
9899
atom.packages.loadPackage(path.join(__dirname, 'fixtures', 'package-with-readme'))

0 commit comments

Comments
 (0)