-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #661 from SkylabCoders/feature/06-testing
Add some tests
- Loading branch information
Showing
3 changed files
with
56 additions
and
37 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
00-TEAMS/06-TEAM/src/pages/movie-details/MovieDetails.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// import React from 'react'; | ||
// import { render, screen } from '../../common/test/index'; | ||
import { getMovieById, getCastMovie, loadRecomended } from '../../application/store/actions/actionsCreator'; | ||
|
||
describe('Given a function getMovieById', () => { | ||
describe('When invoked', () => { | ||
test('Should dispatch LOAD_MOVIE', async () => { | ||
const dispatch = jest.fn(); | ||
await getMovieById('460465')(dispatch); | ||
expect(dispatch).toHaveBeenCalled(); | ||
}); | ||
}); | ||
}); | ||
|
||
describe('Given a function getCastMovie', () => { | ||
describe('When invoked', () => { | ||
test('Should dispatch LOAD_CAST', async () => { | ||
const dispatch = jest.fn(); | ||
await getCastMovie('460465')(dispatch); | ||
expect(dispatch).toHaveBeenCalled(); | ||
}); | ||
}); | ||
}); | ||
|
||
describe('Given a function loadRecomended', () => { | ||
describe('When invoked', () => { | ||
test('Should dispatch LOAD_RECOMENDED', async () => { | ||
const dispatch = jest.fn(); | ||
await loadRecomended('460465')(dispatch); | ||
expect(dispatch).toHaveBeenCalled(); | ||
}); | ||
}); | ||
}); |
23 changes: 23 additions & 0 deletions
23
00-TEAMS/06-TEAM/src/pages/show-detail/showdetails.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// import React from 'react'; | ||
// import { render, screen } from '../../common/test/index'; | ||
import { getShowById, loadRecommendedShows } from '../../application/store/actions/actionsCreator'; | ||
|
||
describe('Given a function getShowById', () => { | ||
describe('When invoked', () => { | ||
test('Should dispatch LOAD_SHOW', async () => { | ||
const dispatch = jest.fn(); | ||
await getShowById('79460')(dispatch); | ||
expect(dispatch).toHaveBeenCalled(); | ||
}); | ||
}); | ||
}); | ||
|
||
describe('Given a function loadRecommendedShows', () => { | ||
describe('When invoked', () => { | ||
test('Should dispatch LOAD_SHOWS_RECOMMENDED', async () => { | ||
const dispatch = jest.fn(); | ||
await loadRecommendedShows('79460')(dispatch); | ||
expect(dispatch).toHaveBeenCalled(); | ||
}); | ||
}); | ||
}); |
This file was deleted.
Oops, something went wrong.