Skip to content

Commit 1d37f45

Browse files
Merge pull request #60 from blinkmobile/ON-4775
ON-4775 # renamed search function to searchJobs in Jobs class
2 parents c91cf69 + 0649c65 commit 1d37f45

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

classes/Jobs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ module.exports = class Jobs extends OneBlinkAPI {
6565
return super.deleteRequest(`/jobs/${jobId}`)
6666
}
6767

68-
async search(
68+
async searchJobs(
6969
options /* : ?mixed */
7070
) /* : Promise<JobsSearchResult> */ {
7171
let searchOptions = {}

docs/jobs.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,12 @@ jobs.deleteJob(jobId).then(() => {
9999

100100
- No return value (`undefined`)
101101

102-
## Search
102+
## Search Jobs
103103

104104
### Example
105105

106106
```javascript
107-
const results = await jobs.search({
107+
const results = await jobs.searchJobs({
108108
username: '[email protected]',
109109
formId: 10
110110
})

tests/lib/jobs.test.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -157,39 +157,39 @@ describe('Jobs SDK Class', () => {
157157
const Jobs = require('../../classes/Jobs.js')
158158
const jobs = new Jobs(constructorOptions)
159159
test('should reject form id', () => {
160-
return expect(jobs.search({ formId: 'ten' })).rejects.toThrow(
160+
return expect(jobs.searchJobs({ formId: 'ten' })).rejects.toThrow(
161161
'formId must be provided as a number or not at all'
162162
)
163163
})
164164

165165
test('should reject externalId', () => {
166-
return expect(jobs.search({ externalId: 12345 })).rejects.toThrow(
166+
return expect(jobs.searchJobs({ externalId: 12345 })).rejects.toThrow(
167167
'externalId must be provided as a string or not at all'
168168
)
169169
})
170170

171171
test('should reject username', () => {
172-
return expect(jobs.search({ username: 12345 })).rejects.toThrow(
172+
return expect(jobs.searchJobs({ username: 12345 })).rejects.toThrow(
173173
'username must be provided as a string or not at all'
174174
)
175175
})
176176

177177
test('should reject isSubmitted', () => {
178-
return expect(jobs.search({ isSubmitted: 'maybe?' })).rejects.toThrow(
178+
return expect(jobs.searchJobs({ isSubmitted: 'maybe?' })).rejects.toThrow(
179179
'isSubmitted must be provided as a boolean or not at all'
180180
)
181181
})
182182

183183
test('should reject limit', () => {
184-
return expect(jobs.search({ limit: 'infinite' })).rejects.toThrow(
184+
return expect(jobs.searchJobs({ limit: 'infinite' })).rejects.toThrow(
185185
'limit must be provided as a number or not at all'
186186
)
187187
})
188188

189189
test('should reject offset', () => {
190-
return expect(jobs.search({ offset: 'a little bit' })).rejects.toThrow(
191-
'offset must be provided as a number or not at all'
192-
)
190+
return expect(
191+
jobs.searchJobs({ offset: 'a little bit' })
192+
).rejects.toThrow('offset must be provided as a number or not at all')
193193
})
194194

195195
test('should make search call successfully', async () => {
@@ -209,7 +209,7 @@ describe('Jobs SDK Class', () => {
209209
const Jobs = require('../../classes/Jobs.js')
210210
const jobs = new Jobs(constructorOptions)
211211

212-
await jobs.search({
212+
await jobs.searchJobs({
213213
externalId: 'abc',
214214
formId: 1,
215215
username: '[email protected]',

0 commit comments

Comments
 (0)