Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Ensure thread number is persisted for annotation replies #307

Merged
merged 2 commits into from
Dec 4, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/AnnotationThread.js
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,8 @@ class AnnotationThread extends EventEmitter {
threadID: this.threadID
},
message,
createdBy: this.api.user
createdBy: this.api.user,
pramodsum marked this conversation as resolved.
Show resolved Hide resolved
thread: this.threadNumber
};
}

Expand Down
22 changes: 22 additions & 0 deletions src/__tests__/AnnotationThread-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,28 @@ describe('AnnotationThread', () => {
});
});

describe('createAnnotationData()', () => {
it('should create an annotation data object to post to the API', () => {
const message = 'something';
const type = 'point';
const data = thread.createAnnotationData(type, message);
expect(data).toStrictEqual({
item: {
type: 'file_version',
id: '1'
},
details: {
type,
location: {},
threadID: '2'
},
message,
createdBy: { id: '1' },
thread: '1'
});
});
});

describe('updateTemporaryAnnotation()', () => {
const tempAnnotation = { id: 1 };
const serverAnnotation = {
Expand Down