-
Notifications
You must be signed in to change notification settings - Fork 0
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 #98 from SmartPhoneAppsProject/fix/LentScanScreen
Fix/lent scan screen
- Loading branch information
Showing
34 changed files
with
1,409 additions
and
1,275 deletions.
There are no files selected for viewing
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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,43 @@ | ||
import * as actions from '../../actions'; | ||
import * as types from '../../constants/actionTypes'; | ||
|
||
describe('actions', () => { | ||
test('カメラのパーミッションが許可するアクションが生成されること', () => { | ||
const expected = { | ||
type: types.PERMISSIONS_GRANTED, | ||
}; | ||
expect(actions.permissionsGranted()).toEqual(expected); | ||
}); | ||
|
||
test('カメラのパーミッションが拒否されるアクションが生成されること', () => { | ||
const expected = { | ||
type: types.PERMISSIONS_DENIED, | ||
}; | ||
expect(actions.permissionsDenied()).toEqual(expected); | ||
}); | ||
|
||
test('カメラの読み取り中のアクションが生成されること', () => { | ||
const expected = { | ||
type: types.ISBN_READING, | ||
}; | ||
expect(actions.isbnReading()).toEqual(expected); | ||
}); | ||
|
||
test('カメラの読み取り完了のアクションが生成されること', () => { | ||
const isbn = 1234567890123; | ||
const expected = { | ||
type: types.ISBN_OK, | ||
payload: { | ||
isbn, | ||
}, | ||
}; | ||
expect(actions.isbnOk(isbn)).toEqual(expected); | ||
}); | ||
|
||
test('カメラの読み取りエラーのアクションが生成されること', () => { | ||
const expected = { | ||
type: types.ISBN_INVALID, | ||
}; | ||
expect(actions.isbnInvalid()).toEqual(expected); | ||
}); | ||
}); |
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,24 @@ | ||
import React from 'react'; | ||
import renderer from 'react-test-renderer'; | ||
|
||
import LentScanScreen from '../../components/LentScanScreen'; | ||
|
||
describe('<LentScanScreen />', () => { | ||
it('正しくレンダリングされること', () => { | ||
const tree = renderer | ||
.create(<LentScanScreen | ||
permissions="granted" | ||
status="reading" | ||
isbn={null} | ||
action="return" | ||
permissionsGranted={jest.fn()} | ||
permissionsDenied={jest.fn()} | ||
isbnReading={jest.fn()} | ||
isbnOk={jest.fn()} | ||
isbnInvalid={jest.fn()} | ||
requestChangeStatus={jest.fn()} | ||
/>) | ||
.toJSON(); | ||
expect(tree).toMatchSnapshot(); | ||
}); | ||
}); |
Oops, something went wrong.