Skip to content
Open
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
91e86b5
adjust main.js
deer-wmde Aug 31, 2026
fac3371
migrate login mock handlers
deer-wmde Aug 31, 2026
1e57ddd
add verify email handlers
deer-wmde Sep 1, 2026
66370a5
add complaint and contact message handlers
deer-wmde Sep 1, 2026
de51e27
migrate remaining old handlers
deer-wmde Sep 1, 2026
9cd23e6
formatting
deer-wmde Sep 1, 2026
7c9fdc1
fix obj access
deer-wmde Sep 1, 2026
b553dda
fix wiki details response
deer-wmde Sep 3, 2026
cdef995
Merge branch 'main' into de/msw-continue
deer-wmde Sep 3, 2026
ea156d7
Merge branch 'main' into de/msw-continue
deer-wmde Sep 3, 2026
43d67df
strcit type checks
deer-wmde Sep 3, 2026
ad97409
fix create wiki response
deer-wmde Sep 3, 2026
05e073a
Merge branch 'main' into de/msw-continue
deer-wmde Sep 3, 2026
de0e487
Merge branch 'main' into de/msw-continue
deer-wmde Sep 3, 2026
77bb18a
add handler for current policy
deer-wmde Sep 3, 2026
0e20438
disable mock bypass
deer-wmde Sep 3, 2026
643823a
fix removeWiki
deer-wmde Sep 3, 2026
4930074
fix user
deer-wmde Sep 3, 2026
7d8696f
fix entityimport handler
deer-wmde Sep 3, 2026
108889c
formatting
deer-wmde Sep 3, 2026
132b2e9
remove obsolete note
deer-wmde Sep 3, 2026
eca0ae4
policies handlers
deer-wmde Sep 4, 2026
e965bba
formatting
deer-wmde Sep 4, 2026
b1bb6e0
Merge branch 'main' into de/msw-policies
deer-wmde Sep 4, 2026
4d9a0d1
Merge branch 'main' into de/msw-policies
deer-wmde Sep 4, 2026
9aa1799
Merge branch 'main' into de/msw-policies
deer-wmde Sep 4, 2026
77cf949
Merge branch 'main' into de/msw-policies
deer-wmde Oct 5, 2026
5598b16
Merge branch 'main' into de/msw-policies
deer-wmde Oct 5, 2026
a10720d
adjust api response message
deer-wmde Oct 5, 2026
12ace28
add comment
deer-wmde Oct 6, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 85 additions & 2 deletions src/backend/mocks/default_handlers.js
Comment thread
deer-wmde marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,11 @@
}),

http.post('/api/user/sendVerifyEmail', () => {
return new Response('Already verified')
return new Response('Already verified!')
}),

http.post('/api/user/verifyEmail', () => {
return new Response('Already verified')
return new Response('Already verified!')
}),

http.post('/api/complaint/sendMessage', () => {
Expand Down Expand Up @@ -290,4 +290,87 @@

return Response.json({ items })
}),

@rosalieper rosalieper Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think It will be beneficial to add a comment here about these requiring an update every time there are new policies.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good call!

// Currently in this form this needs to be kept in sync with new policies added in the future
// TODO: find a way to test different scenarios of policy states

Check failure on line 295 in src/backend/mocks/default_handlers.js

View workflow job for this annotation

GitHub Actions / build (22)

Trailing spaces not allowed
http.get('/api/v1/policies/terms-of-use', () => {
const items = [
{
metadata: {
policy_id: 1,
type: 'terms-of-use',
active_from: '2022-01-01',
content_vue_file: 'terms-of-use/version-1.vue',
},
},
{
metadata: {
policy_id: 2,
type: 'terms-of-use',
active_from: '2026-08-27',
content_vue_file: 'terms-of-use/version-2.vue',
},
},
]

return Response.json({ items })
}),

http.get('/api/v1/policies/terms-of-use/by_active_from/2022-01-01', () => {
const metadata = {
policy_id: 1,
type: 'terms-of-use',
active_from: '2022-01-01',
content_vue_file: 'terms-of-use/version-1.vue',
}

return Response.json({ metadata })
}),

http.get('/api/v1/policies/terms-of-use/current', () => {
const metadata = {
policy_id: 2,
type: 'terms-of-use',
active_from: '2026-08-27',
content_vue_file: 'terms-of-use/version-2.vue',
}

return Response.json({ metadata })
}),

http.get('/api/v1/policies/terms-of-use/upcoming', () => {
const message = 'Policy not found.'
return Response.json({ message }, { status: 404 })
}),

http.get('/api/v1/policies/hosting-policy', () => {
const items = [
{
metadata: {
policy_id: 3,
type: 'hosting-policy',
active_from: '2026-08-27',
content_vue_file: 'hosting-policy/version-1.vue',
},
},
]

return Response.json({ items })
}),

http.get('/api/v1/policies/hosting-policy/current', () => {
const metadata = {
policy_id: 3,
type: 'hosting-policy',
active_from: '2026-08-27',
content_vue_file: 'hosting-policy/version-1.vue',
}

return Response.json({ metadata })
}),

http.get('/api/v1/policies/hosting-policy/upcoming', () => {
const message = 'Policy not found.'
return Response.json({ message }, { status: 404 })
}),
]
Loading