-
Notifications
You must be signed in to change notification settings - Fork 352
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(command-status): fix typo Github -> GitHub
- Loading branch information
Showing
5 changed files
with
64 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
const test = require('ava') | ||
|
||
const callCli = require('./utils/call-cli') | ||
const { withMockApi, getCLIOptions } = require('./utils/mock-api') | ||
const { withSiteBuilder } = require('./utils/site-builder') | ||
const { normalize } = require('./utils/snapshots') | ||
|
||
const siteInfo = { | ||
account_slug: 'test-account', | ||
id: 'site_id', | ||
name: 'site-name', | ||
admin_url: 'https://app.netlify.com/sites/test-site/overview', | ||
url: 'https://test-site.netlify.app/', | ||
} | ||
|
||
const user = { full_name: 'Test User', email: 'test@netlify.com' } | ||
|
||
const accounts = [{ slug: siteInfo.account_slug, name: user.full_name, roles_allowed: [] }] | ||
|
||
const routes = [ | ||
{ path: 'sites/site_id', response: siteInfo }, | ||
{ | ||
path: 'accounts', | ||
response: accounts, | ||
}, | ||
{ path: 'user', response: user }, | ||
] | ||
|
||
test('should print status for a linked site', async (t) => { | ||
await withSiteBuilder('linked-site', async (builder) => { | ||
await builder.buildAsync() | ||
|
||
await withMockApi(routes, async ({ apiUrl }) => { | ||
const output = await callCli(['status'], getCLIOptions({ builder, apiUrl })) | ||
t.snapshot(normalize(output)) | ||
}) | ||
}) | ||
}) |
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,23 @@ | ||
# Snapshot report for `tests/command.status.test.js` | ||
|
||
The actual snapshot is saved in `command.status.test.js.snap`. | ||
|
||
Generated by [AVA](https://avajs.dev). | ||
|
||
## should print status for a linked site | ||
|
||
> Snapshot 1 | ||
`──────────────────────┐␊ | ||
Current Netlify User │␊ | ||
──────────────────────┘␊ | ||
[32mName: [39m Test User␊ | ||
[32mEmail: [39m test@netlify.com␊ | ||
────────────────────┐␊ | ||
Netlify Site Info │␊ | ||
────────────────────┘␊ | ||
[32mCurrent site: [39msite-name␊ | ||
[32mAdmin URL: [39m https://app.netlify.com/sites/test-site/overview␊ | ||
[32mSite URL: [39m https://test-site.netlify.app/␊ | ||
[32mSite Id: [39m site_id␊ | ||
` |
Binary file not shown.
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