Merge pull request #714 from Safelite/feature/richardson/SSR-1286
Remove forced NoBreak's and associated test
This commit is contained in:
commit
bd8d15fb62
2 changed files with 1 additions and 47 deletions
|
|
@ -46,32 +46,6 @@ describe('dropdownQuestion.vue', () => {
|
|||
expect(label.text()).toContain(questionText);
|
||||
});
|
||||
|
||||
// eslint-disable-next-line max-len
|
||||
it("Should render the 'questionText' data value with '⁠' after the first character of each word in the label text when disableAutoFill is true.", async () => {
|
||||
// Arrange
|
||||
const wrapper = shallowMount(dropdownQuestion, {
|
||||
propsData: {
|
||||
options: {},
|
||||
disableAutoFill: true
|
||||
},
|
||||
mixins: [mockMixin]
|
||||
});
|
||||
|
||||
// Mock CMS content ...
|
||||
// Trust me, the below instance of the string "Question Text"
|
||||
// actually has the & NoBreak; in it.You just can't see it
|
||||
// Don't believe me? Copy and paste it into Google.
|
||||
// Then inspect the search field element in Dev Tools,
|
||||
// you will see "Q⁠uestion T⁠ext"
|
||||
const expectedQuestionText = 'Question Text';
|
||||
|
||||
// Act
|
||||
const label = wrapper.find('label');
|
||||
|
||||
// Assert
|
||||
expect(label.text()).toContain(expectedQuestionText);
|
||||
});
|
||||
|
||||
it('Should return input id as the id of the select field', async () => {
|
||||
// Arrange
|
||||
const wrapper = shallowMount(dropdownQuestion, {
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
:for="inputId"
|
||||
:aria-label="questionText"
|
||||
class="form-label"
|
||||
v-html="labelText"></label>
|
||||
v-html="questionText"></label>
|
||||
<select
|
||||
:id="inputId"
|
||||
v-model="selectedOption"
|
||||
|
|
@ -107,26 +107,6 @@ export default {
|
|||
set(newValue) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
|
|
|||
Loading…
Reference in a new issue