OMDSCloud/dictation_server/src/features/notification/notification.controller.spec.ts
saito.k d5e5e59f8c Merged PR 128: API実装(ソート条件変更)
## 概要
[Task1835: API実装(ソート条件変更)](https://paruru.nds-tyo.co.jp:8443/tfs/ReciproCollection/fa4924a4-d079-4fab-9fb5-a9a11eb205f0/_workitems/edit/1835)

- ソート条件変更APIを実装
  - トークンからB2CのIDを取得→userテーブルからユーザー情報を取得
  - ユーザーIDでソート条件テーブルを検索→レコードを更新
- ソート条件テーブルにレコードを作成する
  - アカウント作成時の処理にソート条件レコードを作成する処理を追加
  - ユーザー追加時にも処理を追加
- テスト修正

## レビューポイント
- APIの引数をチェックする関数をControllerに配置してもよいか
- ソート条件のレコードを作成するタイミングに漏れはないか
- 実装漏れはないか

## UIの変更
- Before/Afterのスクショなど
- スクショ置き場

## 動作確認状況
- ローカルで確認

## 補足
- 相談、参考資料などがあれば
2023-06-06 08:20:21 +00:00

31 lines
955 B
TypeScript

import { Test, TestingModule } from '@nestjs/testing';
import { NotificationController } from './notification.controller';
import { NotificationService } from './notification.service';
import { ConfigModule } from '@nestjs/config';
describe('NotificationController', () => {
let controller: NotificationController;
const mockNotificationService = {};
beforeEach(async () => {
const module: TestingModule = await Test.createTestingModule({
imports: [
ConfigModule.forRoot({
envFilePath: ['.env.local', '.env'],
isGlobal: true,
}),
],
controllers: [NotificationController],
providers: [NotificationService],
})
.overrideProvider(NotificationService)
.useValue(mockNotificationService)
.compile();
controller = module.get<NotificationController>(NotificationController);
});
it('should be defined', () => {
expect(controller).toBeDefined();
});
});