mirror of
https://github.com/aelve/guide.git
synced 2024-11-23 04:07:14 +03:00
[tests] Markdown in item descriptions
This commit is contained in:
parent
fec63b8a41
commit
e08238bea2
@ -17,6 +17,7 @@ HTML
|
||||
{{> small-control
|
||||
src = "/pencil.svg"
|
||||
title = "edit summary"
|
||||
class = "edit-item-description"
|
||||
action = [| editItemDescription(
|
||||
{{{%js item.uid}}},
|
||||
{{{%js item.description.text}}}); |] }}
|
||||
@ -36,6 +37,7 @@ HTML
|
||||
{{> small-control
|
||||
src = "/pencil.svg"
|
||||
title = "quit editing summary"
|
||||
class = "edit-item-description"
|
||||
action = [| stopEditingItemDescription({{{%js item.uid}}}); |] }}
|
||||
<div class="editor"></div>
|
||||
</div>
|
||||
|
@ -21,8 +21,10 @@ function bigEditor(settings) {
|
||||
'<textarea class="big fullwidth editor-area"\
|
||||
autocomplete="off">\
|
||||
</textarea>\
|
||||
<input type="button" value="Save" style="right-margin:6px">\
|
||||
<input type="button" value="Cancel" style="right-margin:6px">\
|
||||
<input type="button" value="Save"\
|
||||
class="save" style="right-margin:6px">\
|
||||
<input type="button" value="Cancel"\
|
||||
class="cancel" style="right-margin:6px">\
|
||||
<span class="edit-field-instruction"></span>\
|
||||
<a href="/markdown" target="_blank">Markdown</a>';
|
||||
|
||||
|
@ -11,8 +11,7 @@ Both take the following arguments:
|
||||
* src – link to the image
|
||||
* title – title text
|
||||
* action – the JS action to execute on click, must end with a ';'
|
||||
|
||||
img-button also takes an optional "class" argument.
|
||||
* class – optional "class" argument
|
||||
|
||||
|
||||
HTML: img-button
|
||||
@ -21,7 +20,7 @@ HTML: img-button
|
||||
|
||||
HTML: small-control
|
||||
============================================================
|
||||
{{> img-button class="small-control" }}
|
||||
{{> img-button class=[|small-control{{# class}} {{.}}{{/ class}}|] }}
|
||||
|
||||
CSS
|
||||
============================================================
|
||||
|
@ -369,6 +369,13 @@ markdownTests = session "markdown" $ using Firefox $ do
|
||||
click (form :// ".save")
|
||||
".category-notes .notes-like h1" `shouldHaveText` "Test"
|
||||
".category-notes .notes-like p em" `shouldHaveText` "foo"
|
||||
wd "Markdown in item descriptions" $ do
|
||||
item <- createItem "test"
|
||||
form <- openItemDescriptionEditForm item
|
||||
setInput "# Blah\n*bar*" (form :// "textarea")
|
||||
click (form :// ".save")
|
||||
(item :// ".item-description .notes-like h1") `shouldHaveText` "Blah"
|
||||
(item :// ".item-description .notes-like p em") `shouldHaveText` "bar"
|
||||
-- TODO: check that headers in notes Markdown are rendered as headers but
|
||||
-- still have smaller font size
|
||||
|
||||
@ -461,6 +468,11 @@ openItemEditForm item = do
|
||||
click (item :// ".edit-item-info")
|
||||
select (item :// ".item-info form")
|
||||
|
||||
openItemDescriptionEditForm :: CanSelect s => s -> WD Element
|
||||
openItemDescriptionEditForm item = do
|
||||
click (item :// ".item-description .normal .edit-item-description")
|
||||
select (item :// ".item-description .editing")
|
||||
|
||||
-----------------------------------------------------------------------------
|
||||
-- Utilities for webdriver
|
||||
-----------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user