CI/CD - CodeBuild + CodeDeploy + CodePipeline
This commit is contained in:
@@ -448,6 +448,27 @@ describe('database snapshot routes', () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe('resource lifecycle routes', () => {
|
||||
test('routes start, stop, and reboot through the generic adapter lifecycle operations', async () => {
|
||||
const calls: string[] = []
|
||||
const app = appWithRoutes([mockAdapter('aws', {
|
||||
service: 'database',
|
||||
schema: awsDatabaseSchema,
|
||||
start: async (id) => { calls.push(`start:${id}`) },
|
||||
stop: async (id) => { calls.push(`stop:${id}`) },
|
||||
reboot: async (id) => { calls.push(`reboot:${id}`) },
|
||||
})])
|
||||
|
||||
for (const action of ['start', 'stop', 'reboot']) {
|
||||
const response = await app.request(`/api/clouds/aws/services/database/resources/orders-db/${action}`, {method: 'POST'})
|
||||
expect(response.status).toBe(200)
|
||||
expect(await response.json()).toEqual({ok: true})
|
||||
}
|
||||
|
||||
expect(calls).toEqual(['start:orders-db', 'stop:orders-db', 'reboot:orders-db'])
|
||||
})
|
||||
})
|
||||
|
||||
describe('cloud schema routes', () => {
|
||||
test('returns AWS storage schema', async () => {
|
||||
const res = await appWithRoutes().request('/api/clouds/aws/services/storage/schema')
|
||||
|
||||
Reference in New Issue
Block a user