Skip to content

Commit 2cc2867

Browse files
committed
Remove unnecessary file for test case
1 parent 7c80e01 commit 2cc2867

File tree

2 files changed

+15
-14
lines changed

2 files changed

+15
-14
lines changed

src/__tests__/helpers/CustomButton.js

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/__tests__/role.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import {configure, getConfig} from '../config'
22
import {getQueriesForElement} from '../get-queries-for-element'
33
import {render, renderIntoDocument} from './helpers/test-utils'
4-
import {CustomButton} from './helpers/CustomButton'
54

65
test('by default logs accessible roles when it fails', () => {
76
const {getByRole} = render(`<h1>Hi</h1>`)
@@ -576,7 +575,21 @@ test('should find the input using type property instead of attribute', () => {
576575

577576
describe('Web Component Custom Elements', () => {
578577
beforeAll(() => {
579-
customElements.define('custom-button', CustomButton)
578+
customElements.define(
579+
'custom-button',
580+
class CustomButton extends HTMLElement {
581+
constructor() {
582+
super()
583+
584+
this.attachShadow({mode: 'open'})
585+
586+
const button = document.createElement('button')
587+
button.innerHTML = 'Button text'
588+
589+
this.shadowRoot.append(button)
590+
}
591+
},
592+
)
580593
})
581594

582595
test('should find accessible roles in elements that contain a shadowRoot', () => {

0 commit comments

Comments
 (0)