This file contains hidden or 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 favCryptosList = React.createElement( | |
| "ul", | |
| { id: "fav-cryptos-list" }, | |
| React.createElement( | |
| "li", | |
| null, | |
| React.createElement( | |
| "a", | |
| { href: "link-do-strony-eth" }, | |
| "Etherum" |
This file contains hidden or 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 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> | |
| ); |
This file contains hidden or 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 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') | |
| ); |
This file contains hidden or 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
| /* 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> |
This file contains hidden or 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
| ReactDOM.render(bitCoinEl, document.querySelector('#root')); |
This file contains hidden or 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 bitCoinEl = React.createElement('div', { id: "btc" }, 'BitCoin, current price: 8.800 $'); |
This file contains hidden or 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
| 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"); |
This file contains hidden or 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
| expect(getCoinListWrapper().find('[data-cy=coin]').length).toBe(100); | |
| cy.get('[data-cy=coin]').should('have.length', 100); |
This file contains hidden or 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
| cy.get('[data-cy=coin]').should('have.length', 100); |
This file contains hidden or 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
| 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); | |
| }); | |
| }); |