diff --git a/skrub/_reporting/_data/templates/column-summary.html b/skrub/_reporting/_data/templates/column-summary.html index 61cf83fb3..8e3b2676d 100644 --- a/skrub/_reporting/_data/templates/column-summary.html +++ b/skrub/_reporting/_data/templates/column-summary.html @@ -67,12 +67,17 @@

{{ {% if plot_name == "value_counts_plot" %} -
+
Most frequent values
{% set selector_id = "{}_freq_value_select_snippet".format(col_id) %} - @@ -88,7 +93,10 @@

data-content-repr="{{ value.__repr__() }}" data-content-filter="{{ value | filter_equal_snippet(column.name, summary.dataframe_module) }}" >{{ value }} - +

{% endfor %} diff --git a/skrub/_reporting/js_tests/.gitignore b/skrub/_reporting/js_tests/.gitignore index 0704a13f1..f8f359a9d 100644 --- a/skrub/_reporting/js_tests/.gitignore +++ b/skrub/_reporting/js_tests/.gitignore @@ -1,2 +1,3 @@ _reports/ node_modules/ +cypress/screenshots/ diff --git a/skrub/_reporting/js_tests/cypress/e2e/copy-button.cy.js b/skrub/_reporting/js_tests/cypress/e2e/copy-button.cy.js new file mode 100644 index 000000000..d6629339d --- /dev/null +++ b/skrub/_reporting/js_tests/cypress/e2e/copy-button.cy.js @@ -0,0 +1,21 @@ +describe('test using the copybuttons', { + browser: 'electron' +}, () => { + it('copies target content to clipboard', () => { + cy.visit('_reports/employee_salaries.html'); + cy.get('skrub-table-report').shadow().as('report'); + cy.get('@report').find('button[data-target-tab="columns-tab"]') + .click(); + cy.get('@report').find('#col_1').as('col1').find( + '[data-test="frequent-values-details"]').click(); + cy.get('@col1').find( + '[data-test="frequent-values-select-snippet"]').select( + "repr"); + cy.get('@col1').find('[data-test="copybutton-1"]').click({ + force: true + }); + cy.window().its('navigator.clipboard').then((clip) => clip + .readText()).should('be.equal', "'HHS'"); + + }); +});