Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mgmman committed Dec 11, 2024
1 parent 1599c3b commit 1a91503
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
10 changes: 10 additions & 0 deletions src/store/offers/offers.slice.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ describe('offers slice test', () => {
expect(result).toEqual(initialState);
});

it('should return default initial state with empty action', () => {
const emptyAction = { type: '' };

const result = offersSlice.reducer(undefined, emptyAction);

expect(result.city.name).toEqual(initialState.city.name);
expect(result.offers).toEqual([]);
expect(result.favoritesOffers).toEqual([]);
});

it('should change city', () => {
const newState = offersSlice.reducer(initialState, changeCity(AMSTERDAM));
expect(newState.city).toEqual(AMSTERDAM);
Expand Down
1 change: 0 additions & 1 deletion src/store/user/user.slice.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import { AuthorizationStatus } from '../../dataTypes/enums/authorization-status.ts';
import { getMockAuthInfo } from '../../mocks/mock-user.ts';
import { expect, it } from 'vitest';
import { currentOfferSlice } from '../current-offer/current-offer.slice.ts';

describe('user slice test', () => {
const initialState = {
Expand Down

0 comments on commit 1a91503

Please sign in to comment.