'Scenario: excessively long topic descriptions should be truncated so
as to fit within a topic card.
Given I am enrolled in a course with a team configuration and a topic
with a long description
When I visit the Teams page
And I browse topics
Then I should see a truncated topic description'

def test_topic_description_truncation(self):

    initial_description = (('A' + ('    really' * 50)) + '    long    description')
    self.set_team_configuration({u'max_team_size': 1, u'topics': [{'name': '', 'id': '', 'description': initial_description}]})
    self.topics_page.visit()
    truncated_description = self.topics_page.topic_descriptions[0]
    self.assertLess(len(truncated_description), len(initial_description))
    self.assertTrue(truncated_description.endswith('...'))
    self.assertIn(truncated_description.split('...')[0], initial_description)
