'Test that after adding the post, user sorting preference is changing properly
and recently added post is shown.'

def test_navigation_and_sorting(self):

    topic_button = self.thread_page.q(css=".forum-nav-browse-menu-item[data-discussion-id='{}']".format(self.discussion_id))
    self.assertTrue(topic_button.visible)
    topic_button.click()
    sort_page = DiscussionSortPreferencePage(self.browser, self.course_id)
    for sort_type in ['votes', 'comments', 'activity']:
        sort_page.change_sort_preference(sort_type)
        self.assertEqual(self.thread_page.q(css='.forum-nav-thread-title').text[0], 'dummy    thread    title')
