test: add tests for notification clients

Signed-off-by: Heikki Hellgren <heikki.hellgren@op.fi>
This commit is contained in:
Heikki Hellgren
2024-02-06 09:38:09 +02:00
parent 819a7302a2
commit 6ea8b0d106
7 changed files with 210 additions and 7 deletions
@@ -184,7 +184,7 @@ export async function createRouter(
response.json({ status: 'ok' });
});
router.get('/notifications', async (req, res) => {
router.get('/', async (req, res) => {
const user = await getUser(req);
const opts: NotificationGetOptions = {
user: user,
@@ -274,7 +274,7 @@ export async function createRouter(
// Add new notification
// Allowed only for service-to-service authentication, uses `getUsersForEntityRef` to retrieve recipients for
// specific entity reference
router.post('/notifications', async (req, res) => {
router.post('/', async (req, res) => {
const { recipients, origin, payload } = req.body;
const notifications = [];
let users = [];