Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
98d516d9
Commit
98d516d9
authored
Mar 22, 2016
by
Robert Lyon
Committed by
Gerrit Code Review
Mar 22, 2016
Browse files
Merge "Make the form change checker reset correctly with block config modal"
parents
d265e8e3
86f56e0c
Changes
4
Hide whitespace changes
Inline
Side-by-side
htdocs/js/formchangechecker.js
View file @
98d516d9
...
...
@@ -30,7 +30,16 @@ function FormChangeManager() {
}
this
.
add
=
function
(
formid
)
{
self
.
formcheckers
.
push
(
new
FormChangeChecker
(
formid
));
var
alreadyfound
=
self
.
find
(
formid
);
if
(
alreadyfound
===
null
)
{
newform
=
new
FormChangeChecker
(
formid
);
self
.
formcheckers
.
push
(
newform
);
}
else
{
alreadyfound
.
unbind
();
alreadyfound
.
reset
();
alreadyfound
.
bind
();
}
}
this
.
checkDirtyChanges
=
function
()
{
...
...
htdocs/js/views.js
View file @
98d516d9
...
...
@@ -1151,6 +1151,13 @@
function
hideDock
()
{
// Reset the form change checker
var
form
=
formchangemanager
.
find
(
'
instconf
'
);
if
(
form
!==
null
)
{
form
.
unbind
();
form
.
reset
();
}
dock
.
hide
();
}
...
...
htdocs/testing/frameworks/behat/classes/BehatGeneral.php
View file @
98d516d9
...
...
@@ -999,6 +999,28 @@ class BehatGeneral extends BehatBase {
}
/**
* Close the config modal dialog.
*
* @When /^I close the config dialog$/
* @throws ElementNotFoundException
*/
public
function
i_close_config_dialog
()
{
// Find the config dialog close button.
$exception
=
new
ElementNotFoundException
(
$this
->
getSession
(),
'dialog'
);
$xpath
=
"//div[@id='configureblock']"
.
"//div[contains(concat(' ', normalize-space(@class), ' '), ' modal-dialog ')]"
.
"//button[contains(concat(' ', normalize-space(@class), ' '), ' close ')]"
;
$closebutton
=
$this
->
find
(
'xpath'
,
$xpath
,
$exception
);
if
(
$closebutton
->
isVisible
())
{
$closebutton
->
click
();
$this
->
getSession
()
->
getDriver
()
->
getWebDriverSession
()
->
accept_alert
();
return
;
}
}
/**
* Tick the radio button
* https://github.com/Kunstmaan/KunstmaanBehatBundle/blob/master/Features/Context/SubContext/RadioButtonSubContext.php
...
...
test/behat/features/view/edit_page.feature
View file @
98d516d9
...
...
@@ -56,6 +56,17 @@ Scenario: Clicking ID's (Bug 1428456)
When
I delete the block
"Ulysses"
Then
I should not see
"Buck Mulligan"
# Checking we can add a block, make config changes, then delete the block
# without it causing 'unsaved changes' popup when navigating away
And
I follow
"Text"
And
I press
"Add"
And
I wait
"1"
seconds
And I set the following fields to these values
:
|
Block
title
|
Crime
and
punishment
|
|
Block
content
|
<p>On
an
exceptionally
hot
evening
early
in
July
a
young
man
came
out
of
the
garret
in
which
he
lodged
in
S.
Place
and
walked
slowly,
as
though
in
hesitation,
towards
K.
bridge...</p>
|
And
I close the config dialog
And
I scroll to the id
"main-nav"
# Checking if we can change page layout
When
I follow
"Edit layout"
And
I follow
"Create custom layout"
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment