Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Subash Pradhan committed Nov 28, 2024
1 parent 9d84396 commit 17fdbfc
Showing 1 changed file with 40 additions and 42 deletions.
82 changes: 40 additions & 42 deletions tests/resources/credentials.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe('Credentials', () => {

credentials = new Credentials(apiClient);
apiClient.request.mockResolvedValue({});
})
});

describe('list', () => {
it('should call apiClient.request with the correct params', async () => {
Expand All @@ -35,10 +35,10 @@ describe('Credentials', () => {
overrides: {
apiUri: 'https://test.api.nylas.com',
headers: { override: 'bar' },
}
})
})
})
},
});
});
});

describe('find', () => {
it('should call apiClient.request with the correct params', async () => {
Expand All @@ -48,85 +48,84 @@ describe('Credentials', () => {
overrides: {
apiUri: 'https://test.api.nylas.com',
headers: { override: 'bar' },
}
})
},
});

expect(apiClient.request).toHaveBeenCalledWith({
method: 'GET',
path: '/v3/connectors/microsoft/creds/microsoft-id123',
overrides: {
apiUri: 'https://test.api.nylas.com',
headers: { override: 'bar' },
}
})
})
})
},
});
});
});

describe('create', () => {
it('should call apiClient.request with the correct params', async () => {
await credentials.create({
provider: 'microsoft',
requestBody: {
name: "My Microsoft Connector",
name: 'My Microsoft Connector',
credentialType: CredentialType.CONNECTOR,
credentialData: {
clientID: "<CLIENT_ID>",
clientSecret: "<CLIENT_SECRET>"
}
clientID: '<CLIENT_ID>',
clientSecret: '<CLIENT_SECRET>',
},
},
overrides: {
apiUri: 'https://test.api.nylas.com',
headers: { override: 'bar' },
}
})
},
});

expect(apiClient.request).toHaveBeenCalledWith({
method: 'POST',
path: '/v3/connectors/microsoft/creds',
body: {
name: "My Microsoft Connector",
name: 'My Microsoft Connector',
credentialType: CredentialType.CONNECTOR,
credentialData: {
clientID: "<CLIENT_ID>",
clientSecret: "<CLIENT_SECRET>"
}
clientID: '<CLIENT_ID>',
clientSecret: '<CLIENT_SECRET>',
},
},
overrides: {
apiUri: 'https://test.api.nylas.com',
headers: { override: 'bar' },
}
})
})
})
},
});
});
});

describe('update', () => {
it('should call apiClient.request with the correct params', async () => {
await credentials.update({
provider: 'microsoft',
credentialsId: 'microsoft-123',
requestBody: {
name: "Changed Name"
name: 'Changed Name',
},
overrides: {
apiUri: 'https://test.api.nylas.com',
headers: { override: 'bar' },
}
})
},
});

expect(apiClient.request).toHaveBeenCalledWith({
method: 'PUT',
path: '/v3/connectors/microsoft/creds/microsoft-123',
body: {
name: "Changed Name"
name: 'Changed Name',
},
overrides: {
apiUri: 'https://test.api.nylas.com',
headers: { override: 'bar' },
}
})
})
})

},
});
});
});

describe('destroy', () => {
it('should call apiClient.request with the correct params', async () => {
Expand All @@ -136,18 +135,17 @@ describe('Credentials', () => {
overrides: {
apiUri: 'https://test.api.nylas.com',
headers: { override: 'bar' },
}
})
},
});

expect(apiClient.request).toHaveBeenCalledWith({
method: 'DELETE',
path: '/v3/connectors/microsoft/creds/microsoft-1234',
overrides: {
apiUri: 'https://test.api.nylas.com',
headers: { override: 'bar' },
}
})
})
})

})
},
});
});
});
});

0 comments on commit 17fdbfc

Please sign in to comment.