/* global expect, jasmine, describe, test, beforeAll */ 'use strict' import build from '../server/build' import { join } from 'path' import { render as _render } from '../server/render' const dir = join(__dirname, 'fixtures', 'basic') jasmine.DEFAULT_TIMEOUT_INTERVAL = 10000 describe('integration tests', () => { beforeAll(() => build(dir)) test('renders a stateless component', async () => { const html = await render('/stateless') expect(html.includes('')).toBeTruthy() expect(html.includes('

My component!

')).toBeTruthy() }) test('renders a stateful component', async () => { const html = await render('/stateful') expect(html.includes('

The answer is 42

')).toBeTruthy() }) test('header helper renders header information', async () => { const html = await (render('/head')) expect(html.includes('')).toBeTruthy() expect(html.includes('')).toBeTruthy() expect(html.includes('

I can haz meta tags

')).toBeTruthy() }) test('css helper renders styles', async () => { const html = await render('/css') expect(/\.css-\w+/.test(html)).toBeTruthy() expect(/
This is red<\/div>/.test(html)).toBeTruthy() }) test('renders properties populated asynchronously', async () => { const html = await render('/async-props') expect(html.includes('

Diego Milito

')).toBeTruthy() }) test('renders a link component', async () => { const html = await render('/link') expect(html.includes('About')).toBeTruthy() }) }) function render (url, ctx) { return _render(url, ctx, { dir, staticMarkup: true }) }