Skip to content

Instantly share code, notes, and snippets.

View mkczarkowski's full-sized avatar
🚢
Shipping products

Marcin Czarkowski mkczarkowski

🚢
Shipping products
View GitHub Profile
const favCryptosList = React.createElement(
"ul",
{ id: "fav-cryptos-list" },
React.createElement(
"li",
null,
React.createElement(
"a",
{ href: "link-do-strony-eth" },
"Etherum"
const favCryptosList = (
<ul id="fav-cryptos-list">
<li><a href="https://www.ethereum.org/">Etherum</a></li>
<li><a href="https://eos.io/">EOS</a></li>
<li><a href="https://neo.org/">NEO</a></li>
</ul>
);
const favCryptosList = React.createElement(
'ul', {
id: 'fav-cryptos-list'
},
React.createElement('li', { href: 'https://www.ethereum.org/' }, 'Etherum'),
React.createElement('li', { href: 'https://eos.io/' }, 'EOS'),
React.createElement('li', { href: 'https://neo.org/' }, 'NEO')
);
/* DOM przed wywołaniem ReactDOM.render(bitCoinEl, document.querySelector('#root')) */
<div id="root"></div>
/* DOM po wywołaniu ReactDOM.render(bitCoinEl, document.querySelector('#root')) */
<div id="root">
<div>BitCoin, current price: 8.800 $</div>
</div>
ReactDOM.render(bitCoinEl, document.querySelector('#root'));
const bitCoinEl = React.createElement('div', { id: "btc" }, 'BitCoin, current price: 8.800 $');
var d3 = require('d3')
, jsdom = require('jsdom/lib/old-api.js')
, fs = require('fs')
, htmlStub = '<html><head></head><body><div id="dataviz-container"></div><script src="js/d3.v3.min.js"></script></body></html>'
var MongoClient = require('mongodb').MongoClient;
var url = "mongodb://localhost:27017/";
MongoClient.connect(url, function(err, db) {
if (err) throw err;
var dbo = db.db("scan");
expect(getCoinListWrapper().find('[data-cy=coin]').length).toBe(100);
cy.get('[data-cy=coin]').should('have.length', 100);
cy.get('[data-cy=coin]').should('have.length', 100);
describe('App', () => {
it('renders with initial data', () => {
cy.server();
cy.route('GET', '/v2/ticker/?limit=100').as('fetchCryptos');
cy.visit('http://localhost:3000');
cy.wait('@fetchCryptos', { timeout: 10000 });
cy.get('[data-cy=coin]').should('have.length', 100);
});
});