Skip to content

Commit 9dad012

Browse files
authored
Merge pull request #502 from klee-contrib/validite-html
fix(HtmlValidity): 🐛 Correction validité Html
2 parents 7dd83b2 + b8badc9 commit 9dad012

File tree

7 files changed

+6
-11
lines changed

7 files changed

+6
-11
lines changed

src/components/DsfrCheckbox/DsfrCheckbox.e2e.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ describe('DsfrCheckbox', () => {
3232
.should('be.visible')
3333
.find('input')
3434
.should('have.attr', 'type', 'checkbox')
35-
.should('have.attr', 'role', 'checkbox')
3635
.get('.fr-checkbox-group')
3736
.find('.fr-label')
3837
.should('be.visible')
@@ -74,7 +73,6 @@ describe('DsfrCheckbox', () => {
7473
.should('be.visible')
7574
.find('input')
7675
.should('have.attr', 'type', 'checkbox')
77-
.should('have.attr', 'role', 'checkbox')
7876
.get('.fr-checkbox-group')
7977
.find('.fr-label')
8078
.should('be.visible')

src/components/DsfrCheckbox/DsfrCheckbox.spec.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ describe('DsfrCheckbox', () => {
3232
// Then
3333
expect(labelEl).toHaveClass('fr-label')
3434
expect(input.checked).toBe(true)
35-
expect(input).toHaveAttribute('aria-checked', 'true')
3635
expect(inputCheckBox).toBeInTheDocument()
3736
expect(labelEl.getAttribute('for')).toBe(inputCheckBox.id)
3837
expect(inputCheckBox.getAttribute('type')).toBe('checkbox')
@@ -70,7 +69,6 @@ describe('DsfrCheckbox', () => {
7069
expect(labelEl).toHaveClass('fr-label')
7170
expect(inputCheckBox).toBeInTheDocument()
7271
expect(input.checked).toBe(false)
73-
expect(input).toHaveAttribute('aria-checked', 'false')
7472
expect(labelEl.getAttribute('for')).toBe(inputCheckBox.id)
7573
expect(inputCheckBox.getAttribute('type')).toBe('checkbox')
7674
expect(inputCheckBox).toHaveAttribute('disabled')

src/components/DsfrCheckbox/DsfrCheckbox.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export default defineComponent({
1616
type: String,
1717
required: true,
1818
},
19+
required: Boolean,
1920
modelValue: Boolean,
2021
label: {
2122
type: String,
@@ -60,9 +61,7 @@ export default defineComponent({
6061
:id="id"
6162
:name="name"
6263
type="checkbox"
63-
role="checkbox"
6464
:checked="modelValue"
65-
:aria-checked="modelValue"
6665
v-bind="$attrs"
6766
:data-testid="`input-checkbox-${id}`"
6867
:data-test="`input-checkbox-${id}`"
@@ -78,7 +77,7 @@ export default defineComponent({
7877
<!-- @slot Slot pour indiquer que le champ est obligatoire. Par défaut, met une astérisque si `required` est à true (dans un `<span class="required">`) -->
7978
<slot name="required-tip">
8079
<span
81-
v-if="$attrs.required"
80+
v-if="required"
8281
class="required"
8382
>&nbsp;*</span>
8483
</slot>

src/components/DsfrCheckbox/DsfrCheckboxSet.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ describe('DsfrCheckboxSet', () => {
3838
const legendText = "Légende de l'ensemble des champs"
3939

4040
// When
41-
const { getByText, getAllByTestId } = render(DsfrCheckboxSet, {
41+
const { getByText, container } = render(DsfrCheckboxSet, {
4242
global: {
4343
components: {
4444
VIcon,
@@ -53,7 +53,7 @@ describe('DsfrCheckboxSet', () => {
5353

5454
// Then
5555
expect(getByText(firstLabelText)).toBeInTheDocument()
56-
expect(getAllByTestId('t-checkbox')).toHaveLength(3)
56+
expect(container.querySelectorAll('.fr-checkbox-group')).toHaveLength(3)
5757
})
5858

5959
it('should render a group of checkboxes in fieldset', async () => {

src/components/DsfrCheckbox/DsfrCheckboxSet.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ export default defineComponent({
101101
v-for="option in options"
102102
:id="option.id"
103103
:key="option.id || option.name"
104-
data-testid="t-checkbox"
105104
:name="option.name"
106105
:label="option.label"
107106
:disabled="option.disabled"

src/components/DsfrFooter/DsfrFooter.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ export default defineComponent({
258258
<component
259259
:is="isExternalLink ? 'a' : 'RouterLink'"
260260
class="fr-link-licence no-content-after"
261-
:to="isExternalLink ? routerLinkLicenceTo : null"
261+
:to="isExternalLink ? null : routerLinkLicenceTo"
262262
:href="aLicenceHref"
263263
:target="isExternalLink ? '_blank' : undefined"
264264
rel="noopener noreferrer"

src/components/DsfrSelect/DsfrSelect.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { getRandomId } from '../../utils/random-utils.js'
55
66
export default defineComponent({
77
name: 'DsfrSelect',
8+
inheritAttrs: false,
89
910
props: {
1011
required: Boolean,

0 commit comments

Comments
 (0)