Skip to content

Commit

Permalink
✅ test: 테스트 코드 수정 feed:recent 제거
Browse files Browse the repository at this point in the history
  • Loading branch information
Jo-Minseok committed Jan 1, 2025
1 parent 9f12d00 commit 01d2d42
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions server/test/feed/recent.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { RssAcceptFixture } from '../fixture/rssAccept.fixture';
import { FeedFixture } from '../fixture/feed.fixture';
import { FeedRepository } from '../../src/feed/feed.repository';
import { RedisService } from '../../src/common/redis/redis.service';
import { redisKeys } from '../../src/common/redis/redis.constant';

describe('GET /api/feed/recent E2E Test', () => {
let app: INestApplication;
Expand Down Expand Up @@ -35,9 +34,8 @@ describe('GET /api/feed/recent E2E Test', () => {
const redisService = app.get(RedisService);
const feeds = await feedRepository.save(feedList);
const pipeLine = redisService.redisClient.pipeline();
pipeLine.set(redisKeys.FEED_RECENT_KEY, 'true');
pipeLine.hset(`feed:recent:${feeds[0]['id']}`, feeds[0]);
pipeLine.hset(`feed:recent:${feeds[1]['id']}`, feeds[1]);
pipeLine.hset(`feed:recent:${feeds[0].id}`, feeds[0]);
pipeLine.hset(`feed:recent:${feeds[1].id}`, feeds[1]);
await pipeLine.exec();

//when
Expand All @@ -48,10 +46,10 @@ describe('GET /api/feed/recent E2E Test', () => {
expect(response.body.data.map((feed) => feed.id)).toStrictEqual(['2', '1']);
});

it('피드가 없다면 빈 배열을 반환한다.', async () => {
it('최신 피드가 없다면 빈 배열을 반환한다.', async () => {
//given
const redisService = app.get(RedisService);
await redisService.redisClient.set(redisKeys.FEED_RECENT_KEY, 'false');
redisService.redisClient.flushdb();

//when
const response = await request(app.getHttpServer()).get('/api/feed/recent');
Expand Down

0 comments on commit 01d2d42

Please sign in to comment.