mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 15:18:08 +02:00
Implement contents for every annotation type
The specification states that `Contents` can be available for every annotation types instead of only for markup annotations.
This commit is contained in:
parent
1421b2f205
commit
cf07918ccb
2 changed files with 30 additions and 2 deletions
|
@ -131,6 +131,20 @@ describe('annotation', function() {
|
|||
dict = ref = null;
|
||||
});
|
||||
|
||||
it('should set and get valid contents', function() {
|
||||
const annotation = new Annotation({ dict, ref, });
|
||||
annotation.setContents('Foo bar baz');
|
||||
|
||||
expect(annotation.contents).toEqual('Foo bar baz');
|
||||
});
|
||||
|
||||
it('should not set and get invalid contents', function() {
|
||||
const annotation = new Annotation({ dict, ref, });
|
||||
annotation.setContents(undefined);
|
||||
|
||||
expect(annotation.contents).toEqual('');
|
||||
});
|
||||
|
||||
it('should set and get a valid creation date', function() {
|
||||
const annotation = new Annotation({ dict, ref, });
|
||||
annotation.setCreationDate('D:20190422');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue