-
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.
Render page notes differently than annotations (#11)
- Loading branch information
Showing
4 changed files
with
55 additions
and
21 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
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
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 |
---|---|---|
|
@@ -48,6 +48,12 @@ def test_without_title(self): | |
"uri": "https://example.com/", | ||
"links": {"incontext": "https://hyp.is/test_annotation_id_1/example.com/"}, | ||
"user_info": {"display_name": "md............................"}, | ||
"target": [ | ||
{ | ||
"source": "https://web.hypothes.is/blog/step-by-step-guide-to-using-hypothesis-for-collaborative-projects/", | ||
"selector": [{"exact": "Annotated text"}], | ||
} | ||
], | ||
} | ||
|
||
assert _format_annotation(annotation) == { | ||
|
@@ -62,7 +68,7 @@ def test_without_title(self): | |
"type": "mrkdwn", | ||
"text": "*Annotation* (<https://hyp.is/test_annotation_id_1/example.com/|in-context link>):", | ||
}, | ||
{"type": "plain_text", "text": "(None)"}, | ||
{"type": "plain_text", "text": "Annotated text"}, | ||
{"type": "plain_text", "text": "(None)"}, | ||
], | ||
} | ||
|
@@ -83,12 +89,33 @@ def test_without_user_info(self): | |
"text": "`test_user_1` annotated <https://example.com/|Annotation title>:", | ||
}, | ||
"fields": [ | ||
{"type": "mrkdwn", "text": "*Quote:*"}, | ||
{ | ||
"type": "mrkdwn", | ||
"text": "*Annotation* (<https://hyp.is/test_annotation_id_1/example.com/|in-context link>):", | ||
"text": "*Page Note* (<https://hyp.is/test_annotation_id_1/example.com/|in-context link>):", | ||
}, | ||
{"type": "plain_text", "text": "(None)"}, | ||
], | ||
} | ||
|
||
def test_page_note(self): | ||
annotation = { | ||
"user": "acct:[email protected]", | ||
"uri": "https://example.com/", | ||
"links": {"incontext": "https://hyp.is/test_annotation_id_1/example.com/"}, | ||
"user_info": {"display_name": "md............................"}, | ||
} | ||
|
||
assert _format_annotation(annotation) == { | ||
"type": "section", | ||
"text": { | ||
"type": "mrkdwn", | ||
"text": "`test_user_1` (md............................) annotated https://example.com/:", | ||
}, | ||
"fields": [ | ||
{ | ||
"type": "mrkdwn", | ||
"text": "*Page Note* (<https://hyp.is/test_annotation_id_1/example.com/|in-context link>):", | ||
}, | ||
{"type": "plain_text", "text": "(None)"}, | ||
], | ||
} |