PLT-4257 Add pop-up asking if user wants to reset status (#6526)
* Add pop-up asking if user wants to reset status * Update test snapshot * Update prop name for old uses of confirm modal * Updating checkbox (#6586) * Updating style for checkbox (#6596)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
02f09b8af9
Коммит
6e7b912ec6
@@ -0,0 +1,54 @@
|
||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||
|
||||
exports[`components/ResetStatusModal should match snapshot 1`] = `
|
||||
<ConfirmModal
|
||||
cancelButtonText={
|
||||
<FormattedMessage
|
||||
defaultMessage="No, keep it as \\"{status}\\""
|
||||
id="modal.manual_status.cancel"
|
||||
values={
|
||||
Object {
|
||||
"status": "",
|
||||
}
|
||||
}
|
||||
/>
|
||||
}
|
||||
checkboxText={
|
||||
<FormattedMessage
|
||||
defaultMessage="Do not ask me again"
|
||||
id="modal.manual_status.ask"
|
||||
values={Object {}}
|
||||
/>
|
||||
}
|
||||
confirmButtonClass="btn btn-primary"
|
||||
confirmButtonText={
|
||||
<FormattedMessage
|
||||
defaultMessage="Yes, set my status to \\"Online\\""
|
||||
id="modal.manual_status.button"
|
||||
values={Object {}}
|
||||
/>
|
||||
}
|
||||
message={
|
||||
<FormattedMessage
|
||||
defaultMessage="Would you like to switch your status to \\"Online\\"?"
|
||||
id="modal.manual_status.message"
|
||||
values={Object {}}
|
||||
/>
|
||||
}
|
||||
onCancel={[Function]}
|
||||
onConfirm={[Function]}
|
||||
show={false}
|
||||
showCheckbox={true}
|
||||
title={
|
||||
<FormattedMessage
|
||||
defaultMessage="Your status is set to \\"{status}\\""
|
||||
id="modal.manual_status.title"
|
||||
values={
|
||||
Object {
|
||||
"status": "",
|
||||
}
|
||||
}
|
||||
/>
|
||||
}
|
||||
/>
|
||||
`;
|
||||
29
webapp/tests/components/reset_status_modal.test.jsx
Обычный файл
29
webapp/tests/components/reset_status_modal.test.jsx
Обычный файл
@@ -0,0 +1,29 @@
|
||||
// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved.
|
||||
// See License.txt for license information.
|
||||
|
||||
import React from 'react';
|
||||
import {shallow} from 'enzyme';
|
||||
|
||||
import ResetStatusModal from 'components/reset_status_modal/reset_status_modal.jsx';
|
||||
|
||||
describe('components/ResetStatusModal', () => {
|
||||
test('should match snapshot', () => {
|
||||
function emptyFunction() {} //eslint-disable-line no-empty-function
|
||||
|
||||
async function fakeAutoReset() { //eslint-disable-line require-await
|
||||
return {status: 'away', manual: true, user_id: 'fake'};
|
||||
}
|
||||
|
||||
const wrapper = shallow(
|
||||
<ResetStatusModal
|
||||
autoResetPref=''
|
||||
actions={{
|
||||
autoResetStatus: fakeAutoReset,
|
||||
setStatus: emptyFunction,
|
||||
savePreferences: emptyFunction
|
||||
}}
|
||||
/>
|
||||
);
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
Ссылка в новой задаче
Block a user