Skip to content

Commit

Permalink
Add tests for Dev Connect (forem#988)
Browse files Browse the repository at this point in the history
  • Loading branch information
mariocsee authored and maestromac committed Oct 30, 2018
1 parent 92b6020 commit b5446e1
Show file tree
Hide file tree
Showing 15 changed files with 1,205 additions and 6 deletions.
17 changes: 17 additions & 0 deletions app/javascript/chat/__tests__/__snapshots__/alert.test.jsx.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`<Alert /> should render and test snapshot 1`] = `
<div
class="chatalert__default "
>
More new messages below
</div>
`;

exports[`<Alert /> should render and test snapshot with hidden class 1`] = `
<div
class="chatalert__default chatalert__default--hidden"
>
More new messages below
</div>
`;
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`<CodeEditor /> should render and test snapshot 1`] = `
<div
class="chatcodeeditor"
id="codeeditor"
>
<div
class="chatcodeeditor__header"
>
Experimental (WIP)
</div>
</div>
`;
21 changes: 21 additions & 0 deletions app/javascript/chat/__tests__/__snapshots__/compose.test.jsx.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`<Compose /> behavior with message should render and test snapshot 1`] = `
<div
class="messagecomposer"
>
<textarea
class="messagecomposer__input"
id="messageform"
maxLength="1000"
onKeyDown={[Function]}
placeholder="Message goes here"
/>
<button
class="messagecomposer__submit"
onClick={[Function]}
>
SEND
</button>
</div>
`;
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`<GithubRepo /> with fake token should have the proper elements, attributes and values with states set 1`] = `
RenderContext {
"0": VNode {
"attributes": Object {
"activeChannelId": 12345,
"githubToken": "some_token",
"pusherKey": "ASDFGHJKL",
"resource": Object {
"args": "someargs",
},
},
"children": Array [],
"key": undefined,
"nodeName": [Function],
},
"length": 1,
}
`;

exports[`<GithubRepo /> with fake token should render and test snapshot 1`] = `
<div
class="activecontent__githubrepo"
>
<div
class="activecontent__githubrepoheader"
>
<a
href="/Users/benhalpern/dev/dev.to_core/app"
/>
</div>
<div
class="activecontent__githubrepofiles"
/>
</div>
`;

exports[`<GithubRepo /> with no token should render and test snapshot 1`] = `
<div
class="activecontent__githubrepo"
>
<div
class="activecontent__githubrepoheader"
>
<em>
Authentication required
</em>
</div>
<p>
You must
<a
data-no-instant={true}
href="/users/auth/github"
>
authenticate with GitHub
</a>
to use this feature.
</p>
</div>
`;
63 changes: 63 additions & 0 deletions app/javascript/chat/__tests__/__snapshots__/message.test.jsx.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`<Message /> should render and test snapshot 1`] = `
<div
class="chatmessage"
>
<div
class="chatmessage__profilepic"
>
<a
data-content="users/undefined"
href="/asdf"
target="_blank"
>
<img
alt="asdf profile"
class="chatmessagebody__profileimage"
data-content="users/undefined"
src=""
/>
</a>
</div>
<div
class="chatmessage__body"
>
<span
class="chatmessagebody__username"
style={
Object {
"color": "#00FFFF",
}
}
>
<a
class="chatmessagebody__username--link"
data-content="users/undefined"
href="/asdf"
target="_blank"
>
asdf
</a>
</span>
<span />
<div
class="chatmessage__bodytext"
>
<span
class="chatmessagebody__message"
dangerouslySetInnerHTML={
Object {
"__html": "WE BUILT THIS CITY",
}
}
style={
Object {
"color": "black",
}
}
/>
</div>
</div>
</div>
`;
Loading

0 comments on commit b5446e1

Please sign in to comment.