Merge pull request #713 from Safelite/feature/richardson/SSR-1272
remove labelText code. FMG does not have this.
This commit is contained in:
commit
4bbb7d877f
2 changed files with 1 additions and 57 deletions
|
|
@ -722,38 +722,6 @@ describe('TextboxQuestion', () => {
|
|||
expect(wrapper.emitted('update:modelValue')[0]).toEqual([newValue]); // emitted with expected payload
|
||||
});
|
||||
});
|
||||
describe('labelText', () => {
|
||||
test('should return the question text with no break characters if disableAutoFill is true', () => {
|
||||
// Arrange
|
||||
const disableAutoFill = true;
|
||||
const wrapper = shallowMount(textboxQuestion, {
|
||||
propsData: { disableAutoFill },
|
||||
mixins: [mockMixin],
|
||||
global: {
|
||||
directives: { maska: jest.fn() }
|
||||
}
|
||||
});
|
||||
// TODO this seems like strange behavior to me
|
||||
const expectedLabelText = 'Q⁠uestion T⁠ext';
|
||||
|
||||
// Assert
|
||||
expect(wrapper.vm.labelText).toBe(expectedLabelText);
|
||||
});
|
||||
test('should return the question text as it is if disableAutoFill is false', () => {
|
||||
// Arrange
|
||||
const disableAutoFill = false;
|
||||
const wrapper = shallowMount(textboxQuestion, {
|
||||
propsData: { disableAutoFill },
|
||||
mixins: [mockMixin],
|
||||
global: {
|
||||
directives: { maska: jest.fn() }
|
||||
}
|
||||
});
|
||||
|
||||
// Assert
|
||||
expect(wrapper.vm.labelText).toBe(questionText);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('watch', () => {
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
:aria-label="questionText"
|
||||
class="form-label"
|
||||
:class="[questionAlignment === 'center' ? 'text-center w-100 mb-5' : '']"
|
||||
v-html="labelText"></label>
|
||||
v-html="questionText"></label>
|
||||
<div
|
||||
class="input-wrapper"
|
||||
:class="[
|
||||
|
|
@ -162,30 +162,6 @@ export default {
|
|||
this.$emit('update:modelValue', newValue);
|
||||
}
|
||||
},
|
||||
labelText: {
|
||||
get() {
|
||||
const noBreakChar = '⁠';
|
||||
let questionText = '';
|
||||
if (this.disableAutoFill) {
|
||||
const words = this.questionText.toString().split(/[ ]+/);
|
||||
words.forEach((word) => {
|
||||
const position = 1;
|
||||
const newWord = [
|
||||
word.toString().slice(0, position),
|
||||
noBreakChar,
|
||||
word.toString().slice(position)
|
||||
].join('');
|
||||
questionText += `${newWord} `;
|
||||
});
|
||||
|
||||
questionText = questionText.trimEnd();
|
||||
} else {
|
||||
questionText = this.questionText.toString();
|
||||
}
|
||||
|
||||
return questionText;
|
||||
}
|
||||
},
|
||||
getMaskFromProp() {
|
||||
if (this.mask) {
|
||||
if (this.mask.mask) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue