+
+ it('should have a welcome message', async function () {
+ let welcome_message = await page.$eval('#welcome h2', el => el.textContent);
+ assert.deepStrictEqual(welcome_message, 'Welcome to Nominatim');
+ });
+
+ it('should have a last_updated_: ... ago data', async function () {
+ await page.waitForSelector('abbr[id="data-date"]');
+
+ let last_updated = await page.$eval('abbr[id="data-date"]', el => el.textContent);
+ assert.ok(last_updated.includes('ago'));
+ });
+
+ it('should show map bounds buttons', async function () {
+ await page.waitForSelector('#map');
+ let show_map_pos_handle = await page.$('#show-map-position');
+ let map_pos_handle = await page.$('#map-position');
+
+ await show_map_pos_handle.click();
+ assert.strictEqual(await map_pos_handle.evaluate(node => node.style.display), 'block');
+
+ let map_pos_details = await page.$eval('#map-position-inner', el => el.textContent);
+ map_pos_details = map_pos_details.split(' \n');
+
+ let map_center_coor = map_pos_details[0]
+ .split('map center: ')[1].split(' view')[0].split(',');
+ let map_zoom = map_pos_details[1].split('map zoom: ')[1];
+ let map_viewbox = map_pos_details[2].split('viewbox: ')[1].split(',');
+ let last_click = map_pos_details[3].split('last click: ')[1];
+
+ assert.deepStrictEqual(map_center_coor.length, 2);
+ assert.ok(map_zoom);
+ assert.deepStrictEqual(map_viewbox.length, 4);
+ assert.deepStrictEqual(last_click, 'undefined');
+
+ await page.click('#map-position-close a');
+ assert.strictEqual(await map_pos_handle.evaluate(node => node.style.display), 'none');
+ });