Fix JS tests related to a11y a to button change

This commit is contained in:
Yohan Boniface 2023-10-27 12:55:24 +02:00
parent 1d94ebbaa3
commit c5a28755a2
5 changed files with 8 additions and 8 deletions

View file

@ -205,7 +205,7 @@ describe('L.U.Choropleth', function () {
})
after(function () {
this.server.restore()
//resetMap()
resetMap()
})
describe('#init()', function () {

View file

@ -78,7 +78,7 @@ describe('L.U.Controls', function () {
describe('#exportPanel()', function () {
it('should be opened at datalayer button click', function () {
let button = qs('.leaflet-control-embed a')
let button = qs('.leaflet-control-embed button')
assert.ok(button)
happen.click(button)
assert.ok(qs('#umap-ui-container .umap-share'))

View file

@ -341,7 +341,7 @@ describe('L.U.DataLayer', function () {
happen.click(
qs('#browse_data_toggle_' + L.stamp(this.datalayer) + ' .layer-edit')
)
deleteLink = qs('a.delete_datalayer_button')
deleteLink = qs('button.delete_datalayer_button')
assert.ok(deleteLink)
})

View file

@ -50,7 +50,7 @@ describe('L.U.Map', function () {
})
it('enable edit on click on toggle button', function () {
var el = qs('div.leaflet-control-edit-enable a')
var el = qs('div.leaflet-control-edit-enable button')
happen.click(el)
assert.isTrue(L.DomUtil.hasClass(document.body, 'umap-edit-enabled'))
})
@ -109,7 +109,7 @@ describe('L.U.Map', function () {
var button = qs('a.update-map-settings')
assert.ok(button, 'update map info button exists')
happen.click(button)
var deleteLink = qs('a.umap-delete')
var deleteLink = qs('button.umap-delete')
assert.ok(deleteLink, 'delete map button exists')
sinon.spy(window, 'confirm')
this.server.respondWith('POST', path, JSON.stringify({ redirect: '#' }))
@ -301,7 +301,7 @@ describe('L.U.Map', function () {
})
it('should update title bar (umap format import)', function () {
var title = qs('#map div.umap-main-edit-toolbox a.map-name')
var title = qs('#map div.umap-main-edit-toolbox button.map-name')
assert.equal(title.innerHTML, 'Imported map')
})

View file

@ -44,7 +44,7 @@ var resetMap = function () {
document.body.className = ''
}
var enableEdit = function () {
happen.click(qs('div.leaflet-control-edit-enable a'))
happen.click(qs('div.leaflet-control-edit-enable button'))
}
var disableEdit = function () {
happen.click(qs('.leaflet-control-edit-disable'))
@ -57,7 +57,7 @@ var clickCancel = function () {
window.confirm = function (text) {
return true
}
happen.click(qs('a.leaflet-control-edit-cancel'))
happen.click(qs('button.leaflet-control-edit-cancel'))
happen.once(document.body, { type: 'keypress', keyCode: 13 })
window.confirm = _confirm
}