-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into jw-grid-font
- Loading branch information
Showing
11 changed files
with
89 additions
and
38 deletions.
There are no files selected for viewing
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
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
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
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
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
File renamed without changes.
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
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
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
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,34 @@ | ||
/* eslint no-undef: 0 */ | ||
|
||
import axios from 'axios' | ||
import sinon from 'sinon' | ||
|
||
import { createIssue } from '../../src/util/github' | ||
|
||
describe('github utility', () => { | ||
let sandbox | ||
const fakeIssue = { | ||
body: 'fake text', | ||
owner: '18f', | ||
repo: 'fake-repo', | ||
title: 'fake title', | ||
token: 'fake-token', | ||
} | ||
|
||
beforeEach(() => { | ||
sandbox = sinon.sandbox.create() | ||
}) | ||
|
||
afterEach(() => { | ||
sandbox.restore() | ||
}) | ||
|
||
it('should post data to the github api', done => { | ||
const spy = sandbox.stub(axios, 'post', () => Promise.resolve([])) | ||
createIssue(fakeIssue).then(() => { | ||
const url = spy.getCall(0).args[0] | ||
expect(url).toEqual('https://api.github.com/repos/18f/fake-repo/issues') | ||
done() | ||
}) | ||
}) | ||
}) |
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 @@ | ||
/* eslint no-undef: 0 */ | ||
|
||
import markdown from '../../src/util/md' | ||
|
||
describe('markdown util', () => { | ||
it('should render markdown to html', () => { | ||
const actual = markdown.render('# test\nfake text') | ||
expect(actual.trim()).toEqual('<h1>test</h1>\n<p>fake text</p>') | ||
}) | ||
|
||
it('should properly render glossary links', () => { | ||
const actual = markdown.render('[yo](#glossary?term=yo)') | ||
expect(actual.trim()).toEqual( | ||
'<p><a href="#glossary?term=yo" class="underline glossary-icon glossary-icon-md">yo</a></p>', | ||
) | ||
}) | ||
}) |