Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('should be accessible with analytics suggestions', async done => {
const analyticsSuggestionsElement = $$('div', {
className: Component.computeCssClassName(AnalyticsSuggestions)
});
const analyticsElement = $$('div', {
className: Component.computeCssClassName(Analytics)
});
getResultsColumn().appendChild(analyticsSuggestionsElement.el);
getResultsColumn().appendChild(analyticsElement.el);
await afterQuerySuccess();
setText(omniboxElement, 'm');
showSuggestions(omniboxElement);
await afterDelay(1000);
const axeResults = await axe.run(getRoot());
expect(axeResults).toBeAccessible();
done();
});
it('should be accessible when configured as a span', async done => {
const tab = $$('span', {
className: Component.computeCssClassName(Tab),
'data-caption': 'All Content',
'data-id': 'All'
});
getTabSection().appendChild(tab.el);
await afterQuerySuccess();
const axeResults = await axe.run(getRoot());
expect(axeResults).toBeAccessible();
done();
});
});
it('should be accessible with analytics suggestions', async done => {
const analyticsSuggestionsElement = $$('div', {
className: Component.computeCssClassName(AnalyticsSuggestions)
});
const analyticsElement = $$('div', {
className: Component.computeCssClassName(Analytics)
});
getResultsColumn().appendChild(analyticsSuggestionsElement.el);
getResultsColumn().appendChild(analyticsElement.el);
await afterQuerySuccess();
setText(omniboxElement, 'm');
showSuggestions(omniboxElement);
await afterDelay(1000);
const axeResults = await axe.run(getRoot());
expect(axeResults).toBeAccessible();
done();
});
const getResultListCardElement = () => {
return $$('div', {
className: Component.computeCssClassName(ResultList),
'data-layout': 'card'
});
};
it('should be accessible', async done => {
const getAdvancedSearchElement = () => {
return $$('div', { className: Component.computeCssClassName(AdvancedSearch) });
};
beforeEach(() => {
addFieldEqualFilter('@filetype', 'youtubevideo');
const cardOverlayElement = getOverlayElement();
const fieldTableElement = $$(
'table',
{
className: Component.computeCssClassName(FieldTable),
'data-allow-minimization': 'false'
},
$$('tr', { 'data-field': '@author', 'data-caption': 'Author' })
);
const facetElement = $$('div', {
className: Component.computeCssClassName(Facet),
'data-field': '@author'
});
cardOverlayElement.append(fieldTableElement.el);
getFacetColumn().appendChild(facetElement.el);
testResultElement(cardOverlayElement.el);
});
function buildQuerySuggestPreview() {
const querySuggestPreviewElement = $$('div', { className: Component.computeCssClassName(QuerySuggestPreview) }).el;
querySuggestPreviewElement.dataset.executeQueryDelay = executeQueryDelay.toString();
getSearchSection().appendChild(querySuggestPreviewElement);
}
const buildErrortReportElement = () => {
const errorReportElement = $$('div', {
className: Component.computeCssClassName(ErrorReport)
});
getResultsColumn().appendChild(errorReportElement.el);
};
const getOmniboxElement = () => {
return $$('div', {
className: Component.computeCssClassName(Omnibox)
});
};
beforeEach(() => {
addFieldEqualFilter('@filetype', 'youtubevideo');
const cardOverlayElement = getOverlayElement();
const fieldTableElement = $$(
'table',
{
className: Component.computeCssClassName(FieldTable),
'data-allow-minimization': 'false'
},
$$('tr', { 'data-field': '@author', 'data-caption': 'Author' })
);
const facetElement = $$('div', {
className: Component.computeCssClassName(Facet),
'data-field': '@author'
});
cardOverlayElement.append(fieldTableElement.el);
getFacetColumn().appendChild(facetElement.el);
testResultElement(cardOverlayElement.el);
});