Skip to content

Commit

Permalink
changed limit of urls to 5
Browse files Browse the repository at this point in the history
  • Loading branch information
lmammino committed May 22, 2017
1 parent ddb20a8 commit c4db0c1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/validateCommandInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ const validateCommandInput = (urls, domain, slashtags) => {
return new Error('Urls/Slashtags mismatch: you specified more slashtags than urls')
}

if (urls.length > 10) {
return new Error('You cannot shorten more than 10 URLs at the time')
if (urls.length > 5) {
return new Error('You cannot shorten more than 5 URLs at the time')
}
}

Expand Down
2 changes: 1 addition & 1 deletion tests/__snapshots__/validateCommandInput.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ exports[`It should return an error if no url is specified 1`] = `[Error: No url

exports[`It should return an error if there are more slashtags than urls 1`] = `[Error: Urls/Slashtags mismatch: you specified more slashtags than urls]`;

exports[`It should return an error if there are more than 10 urls 1`] = `[Error: You cannot shorten more than 10 URLs at the time]`;
exports[`It should return an error if there are more than 5 urls 1`] = `[Error: You cannot shorten more than 5 URLs at the time]`;
9 changes: 2 additions & 7 deletions tests/validateCommandInput.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,13 @@ test('It should return an error if there are more slashtags than urls', () => {
expect(validateCommandInput(['url1', 'url2'], 'somedomain', ['slashtag1', 'slashtag2', 'slashtag3'])).toMatchSnapshot()
})

test('It should return an error if there are more than 10 urls', () => {
test('It should return an error if there are more than 5 urls', () => {
expect(validateCommandInput([
'http://fstack.link/10',
'http://fstack.link/11',
'http://fstack.link/12',
'http://fstack.link/13',
'http://fstack.link/14',
'http://fstack.link/15',
'http://fstack.link/16',
'http://fstack.link/17',
'http://fstack.link/18',
'http://fstack.link/19',
'http://fstack.link/20'
'http://fstack.link/15'
])).toMatchSnapshot()
})

0 comments on commit c4db0c1

Please sign in to comment.