2022-02-04 15:44:19 +00:00
|
|
|
Class {
|
|
|
|
#name : #MarkdeepTest,
|
|
|
|
#superclass : #TestCase,
|
|
|
|
#category : #'Grafoscopio-Utils-Tests'
|
|
|
|
}
|
|
|
|
|
|
|
|
{ #category : #tests }
|
|
|
|
MarkdeepTest >> markdeepTestingPictureSnippet [
|
|
|
|
^ (XMLHTMLParser on: '<div st-class="LePictureSnippet" st-data="OrderedDictionary{''id'':''77774yaTDQC8sESSDssMzQ=='',''parent'':''RBSKVeCRDQCTTfVoCYJWrg=='',''url'':''https://i.imgur.com/OD9P0vG.png'',''created'':''29 January 2022 11:32:19.996608 pm'',''modified'':''29 January 2022 11:32:23.781937 pm'',''creator'':''<unknown>'',''modifier'':''<unknown>''}">
|
|
|
|
<center>
|
|
|
|
<figure>
|
|
|
|
<img src="https://i.imgur.com/OD9P0vG.png" width="60%"/>
|
|
|
|
<figcaption>*Network view of the Malleable Systems TiddlyWiki*
|
|
|
|
</figcaption>
|
|
|
|
</figure>
|
|
|
|
</center>
|
|
|
|
</div>') parseDocument
|
|
|
|
]
|
|
|
|
|
|
|
|
{ #category : #tests }
|
|
|
|
MarkdeepTest >> testLePictureImport [
|
2022-04-05 15:03:41 +00:00
|
|
|
| metadata |
|
|
|
|
metadata := STON fromString: (self markdeepTestingPictureSnippet xpath: '@st-data') stringValue.
|
|
|
|
self assert:
|
|
|
|
(LePictureSnippet new injectMetadataFrom: metadata)
|
2022-02-04 15:44:19 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
{ #category : #tests }
|
|
|
|
MarkdeepTest >> testMetadaIncludesParentId [
|
|
|
|
|
|
|
|
| aPage aSnippetOne aSnippetTwo |
|
|
|
|
aPage := LeUIExamples new database pageBuilder title: 'Test Page'; add.
|
|
|
|
aSnippetOne := aPage snippetBuilder string: 'Parent snippet'; add.
|
|
|
|
aSnippetTwo := aPage snippetBuilder string: 'Child Snippet'; add.
|
|
|
|
aSnippetTwo parent: aSnippetOne.
|
|
|
|
self assert: (aSnippetTwo metadata values includes: aSnippetOne uidString)
|
|
|
|
|
|
|
|
]
|