Skip to content

Instantly share code, notes, and snippets.

@jtorreggiani
jtorreggiani / navigation.spec.js
Last active March 1, 2019 22:57
Navigation tests
it('navigates to todos page on link click', async () => {
const link = await browser.$('=Todos')
await link.click()
const heading = await browser.$('h1')
await expect(browser.getUrl()).resolves.toEqual(`${baseUrl}/todos`)
await expect(heading.getText()).resolves.toEqual('Todos')
})
it('navigates to about page on link click', async () => {
@jtorreggiani
jtorreggiani / Todos.js
Created March 2, 2019 00:44
Basic todos page
import React, { Component } from 'react'
const todosUrl = 'http://localhost:3001/todos'
function Todo ({ number, todo }) {
return (
<li>{number}. { todo.title }</li>
)
}