Skip to content
Snippets Groups Projects
Commit 128d9957 authored by efalcy's avatar efalcy
Browse files

fix id on authority picker

parent 6dd74a3c
Branches
Tags
3 merge requests!3589Hotline,!3534Minsoc hotline 109030 delete not selected keywords search,!3516Minsoc prod
Pipeline #10283 passed with stage
in 43 minutes and 58 seconds
......@@ -42,7 +42,7 @@ pick_url:' . json_encode($view->url($this->_getParams(), null, true)) .'
. $view->tag('div',
$view->formHidden($input_id, $this->_element->getValue())
. $view->tag('span', $this->_element->getRecordLabel())
. $view->tag('span', $this->_element->getRecordLabel(), ['id' => 'authority_subject_selected_value_'.$input_id])
. $view->button_New((new Class_Entity)
->setText($this->_element->getPickButtonLabel())
......
......@@ -26,7 +26,7 @@
var value_holder = this.find('#'+ options.name);
var pick_button = this.find('button').eq(0);
var reset_button = this.find('button').eq(1);
var selected_value = this.find('#authority_subject_selected_value');
var selected_value = this.find('#authority_subject_selected_value_'+options.name);
opacDialogRegisterOnOpen(function() {
$('#opac-dialog button.authority_pick').click(on_pick);
......
......@@ -21,7 +21,7 @@
function call_authority_picker_for(options) {
var insertion_point = $('<div>\
<input type="hidden" id="authority_subject" name="authority_subject">\
<span id="authority_subject_selected_value"></span>\
<span id="authority_subject_selected_value_authority_subject"></span>\
<button class="button new" onclick="return false;" title="" data-url="/recherche/add">Choisir</button>\
<button class="button undo" onclick="return false;" title="Annuler mes modifications" data-url="/recherche/avancee">Annuler</button>\
</div>');
......@@ -79,7 +79,7 @@ test('on empty', function () {
equal(insertion_point.find('input').first().val(), '', 'value should be empty' + insertion_point.html());
equal(insertion_point.find('#authority_subject_selected_value').html(), '', insertion_point.html());
equal(insertion_point.find('#authority_subject_selected_value_authority_subject').html(), '', insertion_point.html());
$('button.authority_pick').first().click();
......@@ -89,13 +89,13 @@ test('on empty', function () {
insertion_point.find("button")[1].click();
equal(insertion_point.find('input').first().val(), '', 'value has been reset' + insertion_point.html());
equal(insertion_point.find('#authority_subject_selected_value').html(), '', 'label has been reset' + insertion_point.html());
equal(insertion_point.find('#authority_subject_selected_value_authority_subject').html(), '', 'label has been reset' + insertion_point.html());
});
test('on already selected', function() {
insertion_point.find('input').first().val('9998988');
insertion_point.find('#authority_subject_selected_value').html('Cosmo999');
insertion_point.find('#authority_subject_selected_value_authority_subject').html('Cosmo999');
insertion_point.find("button").first().click();
equal(opened_urls[0], '/authority-search/index/select_for/subject/render/popup/record_id/9998988');
......
<?php
/**
* Copyright (c) 2012-2014, Agence Française Informatique (AFI). All rights reserved.
*
* BOKEH is free software; you can redistribute it and/or modify
* it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE as published by
* the Free Software Foundation.
*
* There are special exceptions to the terms and conditions of the AGPL as it
* is applied to this software (see README file).
*
* BOKEH is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class AuthorityPickerTest extends PHPUnit_Framework_TestCase {
/** @test */
public function searchInputJStestShouldSuccess() {
exec('phantomjs ' . ROOT_PATH . 'tests_js/lib/qunit-phantomjs-runner/runner.js ' . ROOT_PATH . 'public/opac/js/authority_picker/tests.html', $output, $result);
$this->assertEquals(0, $result, implode("\n", $output));
}
}
?>
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment