forked from forem/forem
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests for Dev Connect (forem#988)
- Loading branch information
1 parent
92b6020
commit b5446e1
Showing
15 changed files
with
1,205 additions
and
6 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
app/javascript/chat/__tests__/__snapshots__/alert.test.jsx.snap
This file contains 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
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> | ||
`; |
14 changes: 14 additions & 0 deletions
14
app/javascript/chat/__tests__/__snapshots__/codeEditor.test.jsx.snap
This file contains 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
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
21
app/javascript/chat/__tests__/__snapshots__/compose.test.jsx.snap
This file contains 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
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> | ||
`; |
61 changes: 61 additions & 0 deletions
61
app/javascript/chat/__tests__/__snapshots__/githubRepo.test.jsx.snap
This file contains 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
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
63
app/javascript/chat/__tests__/__snapshots__/message.test.jsx.snap
This file contains 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
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> | ||
`; |
Oops, something went wrong.