Add label to settings button on discussion page
refs VICE-4739 flag = none Test plan: - Navigate to Discussion list page - Check the settings button - Button has to be contains a settings label Change-Id: Ic6372e2a5b26002ceb1c61ed8a3e5ff255c59171 Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/360516 Reviewed-by: Daniel Matyas Vincze <daniel.vincze@instructure.com> Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> QA-Review: Theo Sorriaux <theo.sorriaux@instructure.com> Product-Review: Tamás Balogh <tamas.balogh@instructure.com>
This commit is contained in:
parent
7a1b980bf6
commit
2d1bb6a178
|
@ -48,12 +48,10 @@ export default class DiscussionSettings extends Component {
|
|||
saveSettings: func.isRequired,
|
||||
toggleModalOpen: func.isRequired,
|
||||
userSettings: propTypes.userSettings.isRequired,
|
||||
buttonText: propTypes.buttonText,
|
||||
}
|
||||
|
||||
static defaultProps = {
|
||||
courseSettings: {},
|
||||
buttonText: '',
|
||||
}
|
||||
|
||||
state = {
|
||||
|
@ -191,7 +189,7 @@ export default class DiscussionSettings extends Component {
|
|||
renderIcon={IconSettingsLine}
|
||||
data-testid="discussion-setting-button"
|
||||
>
|
||||
{this.props.buttonText}
|
||||
{I18n.t('Settings')}
|
||||
<ScreenReaderContent>{I18n.t('Discussion Settings')}</ScreenReaderContent>
|
||||
</Button>
|
||||
<Modal
|
||||
|
|
|
@ -210,7 +210,6 @@ export default class IndexHeader extends Component {
|
|||
toggleModalOpen={this.props.toggleModalOpen}
|
||||
isSettingsModalOpen={this.props.isSettingsModalOpen}
|
||||
isSavingSettings={this.props.isSavingSettings}
|
||||
buttonText={!breakpoints.tablet ? I18n.t('Settings') : ''}
|
||||
/>
|
||||
) : null}
|
||||
{this.renderTrayToolsMenu()}
|
||||
|
|
|
@ -76,7 +76,7 @@ describe('DiscussionsSettings', () => {
|
|||
})
|
||||
|
||||
it('should render discussion settings with buttonText', () => {
|
||||
render(<DiscussionSettings {...makeProps({buttonText: 'Settings'})} />)
|
||||
render(<DiscussionSettings {...makeProps()} />)
|
||||
|
||||
const settingsButton = screen.getByTestId('discussion-setting-button')
|
||||
expect(settingsButton).toHaveTextContent('Settings')
|
||||
|
|
Loading…
Reference in New Issue