Skip to content

Commit 72c6599

Browse files
authored
Bugfixes (#47)
- Add information text when axe-core is not loaded Axe core might not load due to CSP. Add the information to the interface. - Fix `controls` value of toggle button
1 parent ef69498 commit 72c6599

File tree

4 files changed

+21
-15
lines changed

4 files changed

+21
-15
lines changed

package-lock.json

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "baat",
3-
"version": "1.4.1",
3+
"version": "1.4.2",
44
"description": "Bookmarklet for running axe-core tests directly in the Browser",
55
"main": "index.js",
66
"scripts": {
@@ -11,7 +11,7 @@
1111
},
1212
"repository": {
1313
"type": "git",
14-
"url": "git@git.mindscreen.de:allianz/baat.git"
14+
"url": "git@github.com:mindscreen/baat.git"
1515
},
1616
"keywords": [
1717
"axe-core",
@@ -36,7 +36,7 @@
3636
"typescript": "^4.4.3"
3737
},
3838
"dependencies": {
39-
"axe-core": "^4.3.3",
39+
"axe-core": "^4.10.3",
4040
"browser-sync": "^2.27.10"
4141
}
4242
}

src/elements/LibSelection/LibSelection.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { baact, createRef } from '../../../baact/baact'
88
import { theme } from '../../theme'
99
import { BAATEvent, ChangeCore } from '../../types'
1010
import {button} from "../../styles/button";
11+
import { link } from '../../styles/link';
1112

1213
const styles = css`
1314
.visuallyHidden { ${visuallyHiddenStyles} }
@@ -25,6 +26,7 @@ const styles = css`
2526
input {
2627
font-size: ${theme.semanticSizing.font.normal};
2728
}
29+
${link}
2830
`;
2931

3032
interface ILibSelectionAccessor {
@@ -34,8 +36,9 @@ export class LibSelection extends BaseHTMLElement<ILibSelectionAccessor> impleme
3436
loaded: boolean = false
3537
static tagName: string = 'baat-lib-selection'
3638
private loadedContainerRef = createRef<HTMLDivElement>()
37-
private unloadedContainerRef = createRef<HTMLDivElement>()
3839
private loadedTextRef = createRef<HTMLDivElement>()
40+
private unloadedContainerRef = createRef<HTMLDivElement>()
41+
private unloadedTextRef = createRef<HTMLDivElement>()
3942
private fileRef = createRef<HTMLInputElement>()
4043
private source: string = ''
4144

@@ -82,11 +85,14 @@ export class LibSelection extends BaseHTMLElement<ILibSelectionAccessor> impleme
8285
this.shadowRoot?.appendChild(
8386
<div id='container'>
8487
<div id='unloadedContainer' ref={this.unloadedContainerRef}>
88+
<p id='unloadedText' ref={this.unloadedTextRef}>
89+
Axe-core is not loaded. This might be due to security headers (CSP) of the current page. Please select an axe-core file from local disk.<br/>It can be downloaded from <a href="https://tools.caat.report/axe.min.js">https://tools.caat.report/axe.min.js</a>
90+
</p>
8591
<input type='file' accept='.js, text/javascript' id='fileInput' onChange={handleFileChange} ref={this.fileRef}/>
8692
<button type='button' id='fileButton' onClick={() => this.fileRef.value.click()}>Select File</button>
8793
</div>
8894
<div id='loadedContainer' ref={this.loadedContainerRef}>
89-
<div id='loadedText' ref={this.loadedTextRef}></div>
95+
<p id='loadedText' ref={this.loadedTextRef}></p>
9096
<button type='button' id='reloadButton' onClick={() => window[baatSymbol].unloadAxe()}>Change</button>
9197
</div>
9298
</div>

src/elements/Window/Window.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ export class Window extends BaseHTMLElement<IRunnerWindowAccessor> implements IR
322322
<slot name={windowSlots.heading}></slot>
323323
<div id='info' ref={this.infoRef}><slot name={windowSlots.info}></slot></div>
324324
<slot name={windowSlots.actions}></slot>
325-
<button id='foldButton' aria-label='hide window' aria-controls='fold' aria-expanded='true' onClick={handleClick} ref={this.buttonRef}>
325+
<button id='foldButton' aria-label='hide window' aria-controls='content' aria-expanded='true' onClick={handleClick} ref={this.buttonRef}>
326326
<Icon width="24" height="24"><path d="m5 24h40"/></Icon>
327327
</button>
328328
</div>

0 commit comments

Comments
 (0)