Skip to content

Commit

Permalink
Add missing dev dependency (gatsbyjs#2618)
Browse files Browse the repository at this point in the history
* Add missing dev dependency

* Fix tests

* Fix tests (again)

* Add remark as devDependency so version doesn't keep changing
  • Loading branch information
KyleAMathews authored Oct 25, 2017
1 parent 590bb3e commit 89619d1
Show file tree
Hide file tree
Showing 4 changed files with 413 additions and 115 deletions.
4 changes: 3 additions & 1 deletion packages/gatsby-remark-responsive-iframe/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
"license": "MIT",
"devDependencies": {
"babel-cli": "^6.26.0",
"cross-env": "^5.0.5"
"cross-env": "^5.0.5",
"remark": "^7.0.0",
"unist-util-find": "^1.0.1"
},
"dependencies": {
"babel-runtime": "^6.26.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,7 @@ exports[`gatsby-remark-responsive-iframe transforms an iframe with pixel width a
class=\\"gatsby-resp-iframe-wrapper\\"
style=\\"padding-bottom: NaN%; position: relative; height: 0; overflow: hidden;\\"
>
<html><head></head><body><iframe url=\\"http://www.example.com/\\" style=\\"
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
\\"></iframe>
</body></html>
</div>
"
`;
Expand All @@ -75,13 +68,7 @@ exports[`gatsby-remark-responsive-iframe transforms an object with pixel width a
class=\\"gatsby-resp-iframe-wrapper\\"
style=\\"padding-bottom: NaN%; position: relative; height: 0; overflow: hidden;\\"
>
<html><head></head><body><object url=\\"http://www.example.com/\\" style=\\"
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
\\"></object></body></html>
</div>
"
`;
Expand Down
14 changes: 7 additions & 7 deletions packages/gatsby-remark-responsive-iframe/src/__tests__/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,6 @@ const extractObjectTag = mdast =>

const extractIframeTag = mdast => mdast.children[0].value

const shouldntTransform = [
[`100%`, `100`],
[`100`, `100%`],
[`invalid`, `100`],
[`100`, `invalid`],
]

describe(`gatsby-remark-responsive-iframe`, () => {
;[`iframe`, `object`].forEach(tag => {
it(`transforms an ${tag} with unitless width and height`, async () => {
Expand Down Expand Up @@ -64,6 +57,13 @@ describe(`gatsby-remark-responsive-iframe`, () => {
})
})

const shouldntTransform = [
[`100%`, `100`],
[`100`, `100%`],
[`invalid`, `100`],
[`100`, `invalid`],
]

_.map(shouldntTransform, ([width, height]) => {
;[`iframe`, `object`].forEach(tag => {
it(`doesn't transform an ${tag} with dimensions: '${width}' '${height}'`, async () => {
Expand Down
Loading

0 comments on commit 89619d1

Please sign in to comment.