Created
March 6, 2022 07:03
-
-
Save flyerhzm/90977c87b2d52f01953b71093bf9022d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const snippet = "react/html-elements-to-react-bootstrap-components" | |
require(`../../lib/${snippet}`); | |
const dedent = require('dedent'); | |
const { assertConvert } = require("../utils"); | |
describe(snippet, () => { | |
describe("simple", () => { | |
const input = dedent(` | |
import React from 'react'; | |
<div className="container-fluid"> | |
<div /> | |
</div> | |
`) | |
const output = dedent(` | |
import React from 'react'; | |
import { Container } from 'react-bootstrap'; | |
<Container fluid> | |
<div /> | |
</Container> | |
`) | |
assertConvert({ | |
input, | |
output, | |
snippet, | |
path: "code.jsx", | |
}); | |
}); | |
describe("complex", () => { | |
const input = dedent(` | |
import React from 'react'; | |
<div className="container-fluid container-pagination" style={{ display: 'none' }}> | |
<div /> | |
</div> | |
`) | |
const output = dedent(` | |
import React from 'react'; | |
import { Container } from 'react-bootstrap'; | |
<Container fluid className="container-pagination" style={{ display: 'none' }}> | |
<div /> | |
</Container> | |
`) | |
assertConvert({ | |
input, | |
output, | |
snippet, | |
path: "code.jsx", | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment