Add a docker build step.
Some checks failed
Docker Build / Build and Push Backend Image (push) Failing after 1m12s
Docker Build / Build and Push Frontend Image (push) Failing after 53s
Check / Backend (pull_request) Successful in 6m3s
Check / Frontend (pull_request) Successful in 1m54s

This commit is contained in:
Drew 2025-09-27 20:28:17 -07:00
parent ff6837a751
commit 4ba9187b1d
10 changed files with 217 additions and 24 deletions

View file

@ -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 () => {

View file

@ -6,7 +6,7 @@ import type {
ApiError,
} from '~/types/task'
const API_BASE_URL = '/api'
const API_BASE_URL = `${import.meta.env.VITE_API_URL || 'http://localhost:3000'}/api`
class ApiClient {
private async fetchWrapper<T>(