Merge pull request #11917 from nixocio/ui_survey_issue

Fix credential encrypted
This commit is contained in:
Tiago Góes
2022-03-18 10:44:39 -03:00
committed by GitHub
2 changed files with 9 additions and 3 deletions

View File

@@ -116,6 +116,13 @@ function SurveyReorderModal({
const defaultAnswer = (q) => { const defaultAnswer = (q) => {
let component = null; let component = null;
switch (q.type) { switch (q.type) {
case 'password':
component = (
<span id="survey-preview-encrypted">
{t`encrypted`.toUpperCase()}
</span>
);
break;
case 'textarea': case 'textarea':
component = ( component = (
<TextArea <TextArea

View File

@@ -90,7 +90,7 @@ describe('<SurveyReorderModal />', () => {
const question3Value = wrapper.find('textarea'); const question3Value = wrapper.find('textarea');
const question4 = wrapper.find('td[aria-label="Password Question"]'); const question4 = wrapper.find('td[aria-label="Password Question"]');
const question4Value = wrapper.find('TextInputBase#survey-preview-text-c'); const question4Value = wrapper.find('#survey-preview-encrypted');
const question5 = wrapper.find('td[aria-label="Multiple select Question"]'); const question5 = wrapper.find('td[aria-label="Multiple select Question"]');
const question5Value = wrapper const question5Value = wrapper
@@ -110,8 +110,7 @@ describe('<SurveyReorderModal />', () => {
expect(question3Value.prop('value')).toBe('Text Area Question Value'); expect(question3Value.prop('value')).toBe('Text Area Question Value');
expect(question3Value.prop('disabled')).toBe(true); expect(question3Value.prop('disabled')).toBe(true);
expect(question4).toHaveLength(1); expect(question4).toHaveLength(1);
expect(question4Value.prop('value')).toBe('$encrypted$'); expect(question4Value.prop('children')).toBe('ENCRYPTED');
expect(question4Value.prop('isDisabled')).toBe(true);
expect(question5).toHaveLength(1); expect(question5).toHaveLength(1);
expect(question5Value.length).toBe(4); expect(question5Value.length).toBe(4);