Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Зуев Егор
/
wiki.dev
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Authored by
Dan Brown
2016-06-12 12:48:06 +0100
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Commit
bc4978479715f11f8413103f870ee9745109c6be
bc497847
1 parent
7f99903f
Added tests to cover page_move features
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
1 deletions
resources/views/pages/move.blade.php
tests/Entity/EntitySearchTest.php
tests/Entity/SortTest.php
resources/views/pages/move.blade.php
View file @
bc49784
...
...
@@ -32,7 +32,7 @@
<div
class=
"form-group"
>
<div
entity-selector
class=
"entity-selector large"
entity-types=
"book,chapter"
>
<input
type=
"hidden"
entity-selector-input
name=
"entity_selection"
>
<input
type=
"hidden"
entity-selector-input
name=
"entity_selection"
value=
""
>
<input
type=
"text"
placeholder=
"Search"
ng-model=
"search"
ng-model-options=
"{debounce: 200}"
ng-change=
"searchEntities()"
>
<div
class=
"text-center loading"
ng-show=
"loading"
>
@include('partials/loading-icon')
</div>
<div
ng-show=
"!loading"
ng-bind-html=
"entityResults"
></div>
...
...
tests/Entity/EntitySearchTest.php
View file @
bc49784
...
...
@@ -82,4 +82,14 @@ class EntitySearchTest extends TestCase
$this
->
asAdmin
()
->
visit
(
'/search/books?term='
.
$book
->
name
)
->
see
(
'Book Search Results'
)
->
see
(
'.entity-list'
,
$book
->
name
);
}
public
function
test_ajax_entity_search
()
{
$page
=
\BookStack\Page
::
all
()
->
last
();
$notVisitedPage
=
\BookStack\Page
::
first
();
$this
->
visit
(
$page
->
getUrl
());
$this
->
asAdmin
()
->
visit
(
'/ajax/search/entities?term='
.
$page
->
name
)
->
see
(
'.entity-list'
,
$page
->
name
);
$this
->
asAdmin
()
->
visit
(
'/ajax/search/entities?types=book&term='
.
$page
->
name
)
->
dontSee
(
'.entity-list'
,
$page
->
name
);
$this
->
asAdmin
()
->
visit
(
'/ajax/search/entities'
)
->
see
(
'.entity-list'
,
$page
->
name
)
->
dontSee
(
$notVisitedPage
->
name
);
}
}
...
...
tests/Entity/SortTest.php
View file @
bc49784
...
...
@@ -22,4 +22,22 @@ class SortTest extends TestCase
->
dontSee
(
$draft
->
name
);
}
public
function
test_page_move
()
{
$page
=
\BookStack\Page
::
first
();
$currentBook
=
$page
->
book
;
$newBook
=
\BookStack\Book
::
where
(
'id'
,
'!='
,
$currentBook
->
id
)
->
first
();
$this
->
asAdmin
()
->
visit
(
$page
->
getUrl
()
.
'/move'
)
->
see
(
'Move Page'
)
->
see
(
$page
->
name
)
->
type
(
'book:'
.
$newBook
->
id
,
'entity_selection'
)
->
press
(
'Move Page'
);
$page
=
\BookStack\Page
::
find
(
$page
->
id
);
$this
->
seePageIs
(
$page
->
getUrl
());
$this
->
assertTrue
(
$page
->
book
->
id
==
$newBook
->
id
,
'Page book is now the new book'
);
$this
->
visit
(
$newBook
->
getUrl
())
->
seeInNthElement
(
'.activity-list-item'
,
0
,
'moved page'
)
->
seeInNthElement
(
'.activity-list-item'
,
0
,
$page
->
name
);
}
}
\ No newline at end of file
...
...
Please
register
or
sign in
to post a comment