Merge pull request #10290 from weeman1337/fix-10234-delete-empty-groups

Fixes delete empty groups
This commit is contained in:
Roeland Jago Douma 2018-07-20 11:22:03 +02:00 committed by GitHub
commit c6b0df6710
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 35 additions and 5 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -44,8 +44,8 @@
<li v-if="Number.isInteger(item.utils.counter)"
class="app-navigation-entry-utils-counter">{{item.utils.counter}}</li>
<!-- first action if only one action and counter -->
<li v-if="item.utils.actions && item.utils.actions.length === 1 && Number.isInteger(item.utils.counter)"
<!-- first action if only one action -->
<li v-if="item.utils.actions && item.utils.actions.length === 1"
class="app-navigation-entry-utils-menu-button">
<button @click="item.utils.actions[0].action" :class="item.utils.actions[0].icon" :title="item.utils.actions[0].text"></button>
</li>

View file

@ -112,6 +112,18 @@ class AppNavigationContext implements Context, ActorAwareInterface {
*/
public function iSeeThatTheSectionHasACountOf($section, $count) {
PHPUnit_Framework_Assert::assertEquals($this->actor->find(self::counterForTheSection($section), 10)->getText(), $count);
}
}
/**
* @Then I see that the section :section does not have a count
*/
public function iSeeThatTheSectionDoesNotHaveACount($section) {
if (!WaitFor::elementToBeEventuallyNotShown(
$this->actor,
self::counterForTheSection($section),
$timeout = 10 * $this->actor->getFindTimeoutMultiplier())) {
PHPUnit_Framework_Assert::fail("The counter for section $section is still shown after $timeout seconds");
}
}
}

View file

@ -178,7 +178,10 @@ class UsersSettingsContext implements Context, ActorAwareInterface {
}
/**
* Assigning/withdrawing is the same action (it toggles).
*
* @When I assign the user :user to the group :group
* @When I withdraw the user :user from the group :group
*/
public function iAssignTheUserToTheGroup($user, $group) {
$this->actor->find(self::inputForUserInCell('groups', $user))->setValue($group);

View file

@ -56,6 +56,21 @@ Feature: users
# When I click the "Yes" button of the confirmation dialog
# Then I see that the section Group1 is not shown
Scenario: delete an empty group
Given I act as Jane
And I am logged in as the admin
And I open the User settings
# disabled because we need the TAB patch:
# https://github.com/minkphp/MinkSelenium2Driver/pull/244
# And I assign the user user0 to the group Group1
# And I see that the section Group1 is shown
# And I withdraw the user user0 from the group Group1
# And I see that the section Group1 does not have a count
# And I click the "icon-delete" button on the Group1 section
# And I see that the confirmation dialog is shown
# When I click the "Yes" button of the confirmation dialog
# Then I see that the section Group1 is not shown
Scenario: change columns visibility
Given I act as Jane
And I am logged in as the admin