Add a docker build step.
This commit is contained in:
parent
ff6837a751
commit
f4062b99d2
10 changed files with 219 additions and 24 deletions
|
|
@ -52,9 +52,12 @@ describe('API Client', () => {
|
|||
|
||||
const result = await apiClient.listTasks()
|
||||
|
||||
expect(mockFetch).toHaveBeenCalledWith('/api/tasks', {
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
})
|
||||
expect(mockFetch).toHaveBeenCalledWith(
|
||||
'http://localhost:3000/api/tasks',
|
||||
{
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
}
|
||||
)
|
||||
expect(result).toEqual(mockTasks)
|
||||
})
|
||||
|
||||
|
|
@ -94,9 +97,12 @@ describe('API Client', () => {
|
|||
|
||||
const result = await apiClient.getTask(mockTask.id)
|
||||
|
||||
expect(mockFetch).toHaveBeenCalledWith(`/api/tasks/${mockTask.id}`, {
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
})
|
||||
expect(mockFetch).toHaveBeenCalledWith(
|
||||
`http://localhost:3000/api/tasks/${mockTask.id}`,
|
||||
{
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
}
|
||||
)
|
||||
expect(result).toEqual(mockTask)
|
||||
})
|
||||
|
||||
|
|
@ -130,11 +136,14 @@ describe('API Client', () => {
|
|||
|
||||
const result = await apiClient.createTask(newTaskData)
|
||||
|
||||
expect(mockFetch).toHaveBeenCalledWith('/api/tasks', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify(newTaskData),
|
||||
})
|
||||
expect(mockFetch).toHaveBeenCalledWith(
|
||||
'http://localhost:3000/api/tasks',
|
||||
{
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify(newTaskData),
|
||||
}
|
||||
)
|
||||
expect(result).toEqual(mockTask)
|
||||
})
|
||||
|
||||
|
|
@ -174,11 +183,14 @@ describe('API Client', () => {
|
|||
|
||||
const result = await apiClient.updateTask(mockTask.id, updateData)
|
||||
|
||||
expect(mockFetch).toHaveBeenCalledWith(`/api/tasks/${mockTask.id}`, {
|
||||
method: 'PUT',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify(updateData),
|
||||
})
|
||||
expect(mockFetch).toHaveBeenCalledWith(
|
||||
`http://localhost:3000/api/tasks/${mockTask.id}`,
|
||||
{
|
||||
method: 'PUT',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify(updateData),
|
||||
}
|
||||
)
|
||||
expect(result).toEqual(updatedTask)
|
||||
})
|
||||
|
||||
|
|
@ -211,10 +223,13 @@ describe('API Client', () => {
|
|||
const result = await apiClient.deleteTask(mockTask.id)
|
||||
expect(result).toBeNull()
|
||||
|
||||
expect(mockFetch).toHaveBeenCalledWith(`/api/tasks/${mockTask.id}`, {
|
||||
method: 'DELETE',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
})
|
||||
expect(mockFetch).toHaveBeenCalledWith(
|
||||
`http://localhost:3000/api/tasks/${mockTask.id}`,
|
||||
{
|
||||
method: 'DELETE',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
}
|
||||
)
|
||||
})
|
||||
|
||||
it('should handle delete errors', async () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue