Skip to content
This repository was archived by the owner on Nov 28, 2022. It is now read-only.

Commit 824bcc1

Browse files
committed
Prettier
1 parent 786a244 commit 824bcc1

File tree

2 files changed

+27
-7
lines changed

2 files changed

+27
-7
lines changed

packages/api-logs/__tests__/index.test.jsx

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,15 @@ describe('Logs', () => {
6666
test('should fetch based on query with page/limit', async () => {
6767
const comp = shallow(<Logs {...props} />);
6868

69-
const mock = nock('https://metrics.readme.io:443', {"encodedQueryParams":true})
69+
const mock = nock('https://metrics.readme.io:443', { encodedQueryParams: true })
7070
.get('/api/logs')
71-
.query({ url: 'https%3A%2F%2Fdash.readme.io%2Fapi%2Fv1%2Fdocs%2F%7Bslug%7D', id: null, method: 'delete', limit: 5, page: 0 })
71+
.query({
72+
url: 'https%3A%2F%2Fdash.readme.io%2Fapi%2Fv1%2Fdocs%2F%7Bslug%7D',
73+
id: null,
74+
method: 'delete',
75+
limit: 5,
76+
page: 0,
77+
})
7278
.reply(200, [requestmodel]);
7379

7480
await comp.instance().getData();
@@ -79,9 +85,15 @@ describe('Logs', () => {
7985
test('should fetch with group if passed', async () => {
8086
const comp = shallow(<Logs {...props} />);
8187

82-
const mock = nock('https://metrics.readme.io:443', {"encodedQueryParams":true})
88+
const mock = nock('https://metrics.readme.io:443', { encodedQueryParams: true })
8389
.get('/api/logs')
84-
.query({ url: 'https%3A%2F%2Fdash.readme.io%2Fapi%2Fv1%2Fdocs%2F%7Bslug%7D', id: 'someid', method: 'delete', limit: 5, page: 0 })
90+
.query({
91+
url: 'https%3A%2F%2Fdash.readme.io%2Fapi%2Fv1%2Fdocs%2F%7Bslug%7D',
92+
id: 'someid',
93+
method: 'delete',
94+
limit: 5,
95+
page: 0,
96+
})
8597
.reply(200, [requestmodel]);
8698

8799
await comp.instance().getData('someid');
@@ -91,7 +103,9 @@ describe('Logs', () => {
91103

92104
test('should render a "view more" button', () => {
93105
const comp = shallow(<LogTest {...props} />);
94-
expect(comp.find('a[target="_blank"]').prop('href')).toBe('https://metrics.readme.io/logs?url=https%3A%2F%2Fdash.readme.io%2Fapi%2Fv1%2Fdocs%2F%7Bslug%7D&method=delete&id=someid');
106+
expect(comp.find('a[target="_blank"]').prop('href')).toBe(
107+
'https://metrics.readme.io/logs?url=https%3A%2F%2Fdash.readme.io%2Fapi%2Fv1%2Fdocs%2F%7Bslug%7D&method=delete&id=someid',
108+
);
95109
});
96110

97111
test('should render with id', () => {

packages/api-logs/index.jsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,9 @@ class Logs extends React.Component {
9898
const { query, baseUrl } = this.props;
9999
this.setState({ loading: true });
100100

101-
const reqUrl = `${baseUrl}api/logs?${querystring.stringify(Object.assign({}, query, { id: group || null, limit: 5, page: 0 }))}`;
101+
const reqUrl = `${baseUrl}api/logs?${querystring.stringify(
102+
Object.assign({}, query, { id: group || null, limit: 5, page: 0 }),
103+
)}`;
102104

103105
return fetch(reqUrl).then(res => {
104106
return this.handleData(res);
@@ -158,7 +160,11 @@ class Logs extends React.Component {
158160
}
159161

160162
static renderOption(item) {
161-
return <option key={item.id} value={item.id}>{item.name}</option>;
163+
return (
164+
<option key={item.id} value={item.id}>
165+
{item.name}
166+
</option>
167+
);
162168
}
163169

164170
renderSelect() {

0 commit comments

Comments
 (0)