-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge develop into master branch (#131)
* Calling welcome one time (#87) Fixes #86 * Fix broken link to docs/README.md (#95) * Fix broken link to docs/README.md * Fix broken link in README.MD The link to the docs was set to ./docs/index.md. It was changed to ./docs/README,.md * Fixes #93: Split lines in packaging documentation (#93) (#96) * Fixes #99 : Implement Header component (#100) * Fixes #89: Adds layout of home component (#102) * Fixes #103: Implement HomeContent component (#104) - Implement HomeContent component - Add default route to be loaded when Deer loads * Fixes #92: Add editor component (#105) * Fixes #97: Implement Notelist component (#106) * Fixes #98: Implement NoteItem component (#107) * Fixes #108: Support selecting note in noteList (#109) * Fixes #112: Update the packages that Deer depends on (#113) * Fixes #114: Add isNewNoteDisabled property to header component (#115) Add isNewNoteDisabled property to header component and an action to change it * Fixes #111: Support adding new note (#116) * Fixes #117: Improve current code (#118) - Rename NoteList reducer and action to note as it's general and related to notes operations onl - Let NoteEditor be rendered inside HomeContent component * Fixes #119: Add save button (#120) * Fixes #121: update note title when content is changed (#122) * Fixes #123: Replace activeNote with activeNoteIndex (#124) * Support saving and loading note (#126) * Move editorState to activeNoteState * Add save modal * Add note status modal and support note saving * support loading note * Fixes #127: support deleting note (#128) * Fixes #129: support testing (#130) * Fixes #129: support testing
- Loading branch information
Showing
62 changed files
with
1,932 additions
and
57 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,6 @@ build | |
# Ignore Logs | ||
logs | ||
*.log | ||
|
||
# coverage test directory | ||
coverage |
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 |
---|---|---|
@@ -1,3 +1,11 @@ | ||
{ | ||
"extends": ["standard", "standard-react"] | ||
"extends": ["standard", "standard-react"], | ||
"settings": { | ||
"react": { | ||
"version": "16.4.0" | ||
} | ||
}, | ||
"env": { | ||
"jest": true | ||
} | ||
} |
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 |
---|---|---|
|
@@ -19,3 +19,6 @@ build | |
|
||
# distribution directory | ||
dist | ||
|
||
# coverage test directory | ||
coverage |
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 |
---|---|---|
|
@@ -12,3 +12,4 @@ install: | |
script: | ||
- npm run lint | ||
- npm run build | ||
- npm run test |
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 |
---|---|---|
|
@@ -14,6 +14,7 @@ If you make a contribution here, you may add your name and email address here. | |
- Austin Daniel ([email protected]) | ||
- Bekir Durak ([email protected]) | ||
- Andrew Cheng ([email protected]) | ||
- Mahmoud Younes ([email protected]) | ||
|
||
|
||
|
||
|
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,5 @@ | ||
module.exports = { | ||
remote: { | ||
getGlobal: jest.fn() | ||
} | ||
} |
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,3 @@ | ||
module.exports = jest.fn(() => ({ | ||
name: 'test' | ||
})) |
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 @@ | ||
module.exports = jest.fn(() => 'id-string') |
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,28 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`header_actions setDeleteDisabled Dispatches the correct action and payload 1`] = ` | ||
Array [ | ||
Object { | ||
"payload": true, | ||
"type": "UPDATE_DELETE_NOTE_STATE", | ||
}, | ||
] | ||
`; | ||
|
||
exports[`header_actions setNewNoteDisabled Dispatches the correct action and payload 1`] = ` | ||
Array [ | ||
Object { | ||
"payload": true, | ||
"type": "UPDATE_NEW_NOTE_STATE", | ||
}, | ||
] | ||
`; | ||
|
||
exports[`header_actions setSaveDisabled Dispatches the correct action and payload 1`] = ` | ||
Array [ | ||
Object { | ||
"payload": true, | ||
"type": "UPDATE_SAVE_NOTE_STATE", | ||
}, | ||
] | ||
`; |
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,10 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`modal_actions toggleYesNoModal Dispatches the correct action and payload 1`] = ` | ||
Array [ | ||
Object { | ||
"payload": "SAVE_NOTE", | ||
"type": "TOGGLE_SAVE_MODAL", | ||
}, | ||
] | ||
`; |
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,80 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`note_actions addNewNote Dispatches the correct action and payload 1`] = ` | ||
Array [ | ||
Object { | ||
"type": "ADD_NOTE", | ||
}, | ||
] | ||
`; | ||
|
||
exports[`note_actions deleteNoteFromList Dispatches the correct action and payload 1`] = ` | ||
Array [ | ||
Object { | ||
"payload": 3, | ||
"type": "DELETE_NOTE_FROM_LIST", | ||
}, | ||
] | ||
`; | ||
|
||
exports[`note_actions loadNoteContent Dispatches the correct action and payload 1`] = ` | ||
Array [ | ||
Object { | ||
"payload": Object {}, | ||
"type": "LOAD_NOTE_CONTENT", | ||
}, | ||
] | ||
`; | ||
|
||
exports[`note_actions setActiveNoteIndex Dispatches the correct action and payload 1`] = ` | ||
Array [ | ||
Object { | ||
"payload": 3, | ||
"type": "SET_ACTIVE_NOTE", | ||
}, | ||
] | ||
`; | ||
|
||
exports[`note_actions setNoteStatus Dispatches the correct action and payload 1`] = ` | ||
Array [ | ||
Object { | ||
"payload": "SAVING_NOTE", | ||
"type": "SET_NOTE_STATUS", | ||
}, | ||
] | ||
`; | ||
|
||
exports[`note_actions updateActiveNoteState Dispatches the correct action and payload 1`] = ` | ||
Array [ | ||
Object { | ||
"payload": Object {}, | ||
"type": "UPDATE_ACTIVE_NOTE_STATE", | ||
}, | ||
] | ||
`; | ||
|
||
exports[`note_actions updateNoteList Dispatches the correct action and payload 1`] = ` | ||
Array [ | ||
Object { | ||
"type": "UPDATE_NOTE_LIST", | ||
}, | ||
] | ||
`; | ||
|
||
exports[`note_actions updateNoteRev Dispatches the correct action and payload 1`] = ` | ||
Array [ | ||
Object { | ||
"payload": "a123-a123", | ||
"type": "UPDATE_NOTE_REV", | ||
}, | ||
] | ||
`; | ||
|
||
exports[`note_actions updateNoteTitle Dispatches the correct action and payload 1`] = ` | ||
Array [ | ||
Object { | ||
"payload": "Hello world", | ||
"type": "UPDATE_NOTE_TITLE", | ||
}, | ||
] | ||
`; |
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,17 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`welcome_actions getNextLang Dispatches the correct action and payload 1`] = ` | ||
Array [ | ||
Object { | ||
"type": "SET_NEXT_LANG", | ||
}, | ||
] | ||
`; | ||
|
||
exports[`welcome_actions toggleFade Dispatches the correct action and payload 1`] = ` | ||
Array [ | ||
Object { | ||
"type": "TOGGLE_FADE", | ||
}, | ||
] | ||
`; |
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,34 @@ | ||
import configureStore from 'redux-mock-store' | ||
|
||
// Actions to be tested | ||
import * as headerActions from '../../app/actions/header' | ||
|
||
const mockStore = configureStore() | ||
const store = mockStore() | ||
|
||
describe('header_actions', () => { | ||
beforeEach(() => { | ||
store.clearActions() | ||
}) | ||
|
||
describe('setNewNoteDisabled', () => { | ||
test('Dispatches the correct action and payload', () => { | ||
store.dispatch(headerActions.setNewNoteDisabled(true)) | ||
expect(store.getActions()).toMatchSnapshot() | ||
}) | ||
}) | ||
|
||
describe('setSaveDisabled', () => { | ||
test('Dispatches the correct action and payload', () => { | ||
store.dispatch(headerActions.setSaveDisabled(true)) | ||
expect(store.getActions()).toMatchSnapshot() | ||
}) | ||
}) | ||
|
||
describe('setDeleteDisabled', () => { | ||
test('Dispatches the correct action and payload', () => { | ||
store.dispatch(headerActions.setDeleteDisabled(true)) | ||
expect(store.getActions()).toMatchSnapshot() | ||
}) | ||
}) | ||
}) |
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,22 @@ | ||
import configureStore from 'redux-mock-store' | ||
import { ACTIONS } from '../../app/constants/actions' | ||
import * as modalActions from '../../app/actions/modal' | ||
jest.mock('../../__mocks__/pouchdb-browser') | ||
|
||
const mockStore = configureStore() | ||
const store = mockStore() | ||
|
||
global.fetch = () => {} | ||
|
||
describe('modal_actions', () => { | ||
beforeEach(() => { | ||
store.clearActions() | ||
}) | ||
|
||
describe('toggleYesNoModal', () => { | ||
test('Dispatches the correct action and payload', () => { | ||
store.dispatch(modalActions.toggleYesNoModal(ACTIONS.SAVE_NOTE)) | ||
expect(store.getActions()).toMatchSnapshot() | ||
}) | ||
}) | ||
}) |
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,77 @@ | ||
import configureStore from 'redux-mock-store' | ||
|
||
// Actions to be tested | ||
import * as noteActions from '../../app/actions/note' | ||
import { NOTE_STATUS } from '../../app/constants/noteStatus' | ||
|
||
const mockStore = configureStore() | ||
const store = mockStore() | ||
|
||
describe('note_actions', () => { | ||
beforeEach(() => { | ||
store.clearActions() | ||
}) | ||
|
||
describe('addNewNote', () => { | ||
test('Dispatches the correct action and payload', () => { | ||
store.dispatch(noteActions.addNewNote()) | ||
expect(store.getActions()).toMatchSnapshot() | ||
}) | ||
}) | ||
|
||
describe('updateNoteList', () => { | ||
test('Dispatches the correct action and payload', () => { | ||
store.dispatch(noteActions.updateNoteList()) | ||
expect(store.getActions()).toMatchSnapshot() | ||
}) | ||
}) | ||
|
||
describe('setActiveNoteIndex', () => { | ||
test('Dispatches the correct action and payload', () => { | ||
store.dispatch(noteActions.setActiveNoteIndex(3)) | ||
expect(store.getActions()).toMatchSnapshot() | ||
}) | ||
}) | ||
|
||
describe('updateNoteTitle', () => { | ||
test('Dispatches the correct action and payload', () => { | ||
store.dispatch(noteActions.updateNoteTitle('Hello world')) | ||
expect(store.getActions()).toMatchSnapshot() | ||
}) | ||
}) | ||
|
||
describe('updateActiveNoteState', () => { | ||
test('Dispatches the correct action and payload', () => { | ||
store.dispatch(noteActions.updateActiveNoteState({})) | ||
expect(store.getActions()).toMatchSnapshot() | ||
}) | ||
}) | ||
|
||
describe('updateNoteRev', () => { | ||
test('Dispatches the correct action and payload', () => { | ||
store.dispatch(noteActions.updateNoteRev('a123-a123')) | ||
expect(store.getActions()).toMatchSnapshot() | ||
}) | ||
}) | ||
|
||
describe('setNoteStatus', () => { | ||
test('Dispatches the correct action and payload', () => { | ||
store.dispatch(noteActions.setNoteStatus(NOTE_STATUS.SAVING_NOTE)) | ||
expect(store.getActions()).toMatchSnapshot() | ||
}) | ||
}) | ||
|
||
describe('loadNoteContent', () => { | ||
test('Dispatches the correct action and payload', () => { | ||
store.dispatch(noteActions.loadNoteContent({})) | ||
expect(store.getActions()).toMatchSnapshot() | ||
}) | ||
}) | ||
|
||
describe('deleteNoteFromList', () => { | ||
test('Dispatches the correct action and payload', () => { | ||
store.dispatch(noteActions.deleteNoteFromList(3)) | ||
expect(store.getActions()).toMatchSnapshot() | ||
}) | ||
}) | ||
}) |
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,27 @@ | ||
import configureStore from 'redux-mock-store' | ||
|
||
// Actions to be tested | ||
import * as welcomeActions from '../../app/actions/welcome' | ||
|
||
const mockStore = configureStore() | ||
const store = mockStore() | ||
|
||
describe('welcome_actions', () => { | ||
beforeEach(() => { | ||
store.clearActions() | ||
}) | ||
|
||
describe('getNextLang', () => { | ||
test('Dispatches the correct action and payload', () => { | ||
store.dispatch(welcomeActions.getNextLang()) | ||
expect(store.getActions()).toMatchSnapshot() | ||
}) | ||
}) | ||
|
||
describe('toggleFade', () => { | ||
test('Dispatches the correct action and payload', () => { | ||
store.dispatch(welcomeActions.toggleFade()) | ||
expect(store.getActions()).toMatchSnapshot() | ||
}) | ||
}) | ||
}) |
Oops, something went wrong.