File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1- import React , { Component , PropTypes } from 'react'
1+ import React from 'react'
22import { findDOMNode } from 'react-dom'
3- import TestUtils from 'react-addons-test-utils'
43import expect from 'expect.js'
54import Highlight from '../source/Highlight.jsx'
65
76describe ( 'Highlight' , ( ) => {
8- // TODO
7+ const language = 'javascript'
8+ const content = 'var foo = "Foo"; // comment'
9+ const node = document . createElement ( 'div' )
10+ const highlight = React . render (
11+ < Highlight language = { language } >
12+ { content }
13+ </ Highlight > ,
14+ node
15+ )
16+ const highlightDOMNode = findDOMNode ( highlight )
17+
18+ it ( 'should render content with basic markup' , ( ) => {
19+ expect ( highlightDOMNode . className ) . to . contain ( 'hljs' )
20+ expect ( highlightDOMNode . querySelector ( 'code' ) . className ) . to . contain ( 'javascript' )
21+ expect ( highlightDOMNode . querySelector ( '.hljs-keyword' ) . textContent ) . to . contain ( 'var' )
22+ expect ( highlightDOMNode . querySelector ( '.hljs-variable' ) . textContent ) . to . contain ( 'foo' )
23+ expect ( highlightDOMNode . querySelector ( '.hljs-string' ) . textContent ) . to . contain ( '"Foo"' )
24+ expect ( highlightDOMNode . querySelector ( '.hljs-comment' ) . textContent ) . to . contain ( '// comment' )
25+ } )
926} )
You can’t perform that action at this time.
0 commit comments