Skip to content

Commit

Permalink
update API response in domains tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cafreeman committed Feb 12, 2020
1 parent ff314cf commit 01ec8cb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
11 changes: 9 additions & 2 deletions packages/apps/test/commands/domains/add.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ describe('domains:add', () => {
})

describe('adding a domain to an app with multiple certs', () => {
const domainsResponseWithEndpoint = {
...domainsResponse,
sni_endpoint: {
name: 'my-cert',
},
}

describe('using the --cert flag', () => {
test
.stderr()
Expand All @@ -70,7 +77,7 @@ describe('domains:add', () => {
hostname: 'example.com',
sni_endpoint: 'my-cert',
})
.reply(200, domainsResponse),
.reply(200, domainsResponseWithEndpoint),
)
.command(['domains:add', 'example.com', '--app', 'myapp', '--cert', 'my-cert'])
.it('adds the domain to the app', ctx => {
Expand Down Expand Up @@ -125,7 +132,7 @@ describe('domains:add', () => {
hostname: 'example.com',
sni_endpoint: 'my-cert',
})
.reply(200, domainsResponse)
.reply(200, domainsResponseWithEndpoint)
.get('/apps/myapp/sni-endpoints')
.reply(200, certsResponse),
)
Expand Down
5 changes: 4 additions & 1 deletion packages/apps/test/commands/domains/update.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ describe('domains:update', () => {
id: '7ac15e30-6460-48e1-919a-e794bf3512ac',
kind: 'custom',
status: 'succeeded',
sni_endpoint_id: '8cae023a-d8f1-4aca-9929-e516dc011694'}
sni_endpoint: {
id: '8cae023a-d8f1-4aca-9929-e516dc011694',
},
}

test
.stderr()
Expand Down

0 comments on commit 01ec8cb

Please sign in to comment.