Skip to content

Commit

Permalink
test: fix navigation tests
Browse files Browse the repository at this point in the history
  • Loading branch information
QuentinRoy committed Sep 26, 2018
1 parent bb040da commit f058214
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/navigation/navigation.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import navigation, {
navigationFromDrag
} from './navigation';
import expertNavigation from './expert-navigation';
import { longMoves, dwellings } from '../move';
import { longMoves, dwellings, draw } from '../move';
import noviceNavigation from './novice-navigation';

jest.mock('./expert-navigation');
Expand Down Expand Up @@ -38,6 +38,7 @@ describe('confirmedExpertNavigationHOO', () => {
const drag$ = m.hot( '--a-b--c--d-e---f--|').pipe(publishBehavior());
const long$ = m.hot( '-------c----e------|', values);
const sub$ = m.cold( '---D-E---F--|', values);
const etnsh$ = m.hot( '-------------------|');
const expected$ = m.hot('-------(X|)' , { X: sub$ });
drag$.connect();

Expand All @@ -48,10 +49,13 @@ describe('confirmedExpertNavigationHOO', () => {
)
));
longMoves.mockImplementation(() => long$);
draw.mockImplementation(() => drag$);
const mockExpertToNoviceSwitchHOO = jest.fn(() => etnsh$);

m
.expect(confirmedExpertNavigationHOO(drag$, 'mock-model', {
movementsThreshold: 'mock-threshold'
movementsThreshold: 'mock-threshold',
expertToNoviceSwitchHOO: mockExpertToNoviceSwitchHOO
}))
.toBeObservable(expected$);
m.flush();
Expand Down

0 comments on commit f058214

Please sign in to comment.