'Scenario: The component visibility modal shows a validation error when visibility is set to multiple unknown
group ids and multiple known group ids.
Given I have a unit with one component
And that component\'s group access specifies multiple invalid and valid group ids
When I go to the container page for that unit
Then I should see a validation error message on that unit\'s component
And I open the visibility editor modal for that unit\'s component
Then I should see that I have selected multiple deleted groups
And then if I de-select the missing groups
And I save the modal
Then the visibility selection should be the names of the valid groups.
And I should not see any validation errors on the component'

def test_found_and_missing_groups(self):

    self.update_component(self.html_component, {'group_access': {self.id_base: [(self.id_base + 1), (self.id_base + 2), (self.id_base + 3), (self.id_base + 4)]}})
    self._verify_and_remove_missing_content_groups('Dogs,    Cats,    Deleted    Group,    Deleted    Group', (['Dogs', 'Cats'] + ([self.MISSING_GROUP_LABEL] * 2)))
    visibility_editor = self.edit_component_visibility(self.html_component)
    self.verify_selected_partition_scheme(visibility_editor, self.CONTENT_GROUP_PARTITION)
    expected_groups = ['Dogs', 'Cats']
    self.verify_current_groups_message(visibility_editor, ',    '.join(expected_groups))
    self.verify_selected_groups(visibility_editor, expected_groups)
