Skip to content
Snippets Groups Projects
Commit 8b0c777c authored by Bucknell, Mary S.'s avatar Bucknell, Mary S.
Browse files

Fixed selector to the addSVGAccessibility function and fixed tests to properly...

Fixed selector to the addSVGAccessibility function and fixed tests to properly test setting the title and desc tag values.
parent 73fb539a
No related branches found
No related tags found
No related merge requests found
......@@ -291,8 +291,8 @@ const timeSeriesGraph = function (elem) {
.append('svg')
.call(link((elem, layout) => elem.attr('viewBox', `0 0 ${layout.width} ${layout.height}`), layoutSelector))
.call(link(addSVGAccessibility, createStructuredSelector({
titleSelector,
descriptionSelector,
title: titleSelector,
description: descriptionSelector,
isInteractive: () => true
})))
.call(plotSvgDefs)
......
......@@ -70,6 +70,17 @@ const TEST_STATE = {
timeSeries: ['00010:current']
}
},
queryInfo: {
current: {
notes: {
'filter:timeRange': {
mode: 'PERIOD',
periodDays: 7
},
requestDT: new Date('2018-03-30 11:00:00')
}
}
},
requests: {
current: {
timeSeriesCollections: ['coll1']
......@@ -124,10 +135,8 @@ describe('Hydrograph charting module', () => {
beforeEach(() => {
let body = select('body');
let hydrograph = body.append('div')
body.append('div')
.attr('id', 'hydrograph');
hydrograph.append('div')
.attr('class', 'hydrograph-container');
graphNode = document.getElementById('hydrograph');
});
......@@ -179,9 +188,13 @@ describe('Hydrograph charting module', () => {
svg = select('svg');
});
fit('title and desc attributes are present', function() {
expect(svg.attr('title')).toEqual('Test title for 00060');
expect(svg.attr('desc')).toEqual('Test description for 00060');
it('title and desc attributes are present', function() {
const descText = svg.select('desc').text();
expect(svg.select('title').text()).toEqual('Test title for 00060');
expect(descText).toContain('Test description for 00060');
expect(descText).toContain('3/23/2018');
expect(descText).toContain('3/30/2018');
expect(svg.attr('aria-labelledby')).toContain('title');
expect(svg.attr('aria-describedby')).toContain('desc');
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment