Skip to content

Commit 1a82612

Browse files
committed
Ensure instructions edits are saved to Firebase
1 parent ef54833 commit 1a82612

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

src/sagas/projects.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,10 @@ export default function* () {
110110
takeEvery('APPLICATION_LOADED', applicationLoaded),
111111
takeEvery('CREATE_PROJECT', createProject),
112112
takeEvery('CHANGE_CURRENT_PROJECT', changeCurrentProject),
113-
throttle(500, 'UPDATE_PROJECT_SOURCE', updateProjectSource),
113+
throttle(500, [
114+
'UPDATE_PROJECT_SOURCE',
115+
'UPDATE_PROJECT_INSTRUCTIONS',
116+
], updateProjectSource),
114117
takeEvery('USER_AUTHENTICATED', userAuthenticated),
115118
takeEvery('TOGGLE_LIBRARY', toggleLibrary),
116119
]);

test/unit/sagas/projects.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import {
1616
gistNotFound,
1717
projectsLoaded,
1818
toggleLibrary,
19+
updateProjectInstructions,
1920
updateProjectSource,
2021
} from '../../../src/actions/projects';
2122
import {
@@ -230,6 +231,18 @@ test('updateProjectSource', (assert) => {
230231
assert.end();
231232
});
232233

234+
test('updateProjectInstructions', (assert) => {
235+
const scenario = new Scenario();
236+
testSaga(
237+
updateProjectSourceSaga,
238+
updateProjectInstructions(scenario.projectKey, '# Instructions'),
239+
).
240+
next().select().
241+
next(scenario.state).call(saveCurrentProject, scenario.state).
242+
next().isDone();
243+
assert.end();
244+
});
245+
233246
test('toggleLibrary', (assert) => {
234247
const scenario = new Scenario();
235248
testSaga(

0 commit comments

Comments
 (0)