Convert NotificationsController to TypeScript

GitOrigin-RevId: df1c25e3494fb12c2af74be30a85d8b0d59e1789
This commit is contained in:
Andrew Rumble
2025-09-24 08:05:41 +00:00
committed by Copybot
parent ea6b7f2af0
commit 773e5dd856
3 changed files with 84 additions and 34 deletions
@@ -1,15 +1,8 @@
// TODO: This file was created by bulk-decaffeinate.
// Fix any style issues and re-enable lint.
/*
* decaffeinate suggestions:
* DS102: Remove unnecessary code created because of implicit returns
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
*/
import { beforeEach, describe, expect, it, vi } from 'vitest'
const modulePath = '../../../app/js/NotificationsController.js'
const userId = '51dc93e6fb625a261300003b'
const notificationId = 'fb625a26f09d'
const notificationId = '51dc93e6fb625a261300003c'
const notificationKey = 'my-notification-key'
describe('Notifications Controller', () => {
@@ -73,14 +66,14 @@ describe('Notifications Controller', () => {
params: {
user_id: userId,
},
body: stubbedNotification,
body: stubbedNotification[0],
}
await new Promise(resolve => {
controller.addNotification(req, {
sendStatus: code => {
expect(notifications.addNotification).toHaveBeenCalledWith(
userId,
stubbedNotification
stubbedNotification[0]
)
expect(code).toBe(200)
resolve()