Commit 35ea254c authored by Clement Ho's avatar Clement Ho

Add data-test=page for testing pagination pages in admin abuse reports spec

parent 5049cbdb
......@@ -6,5 +6,5 @@
-# total_pages: total number of pages
-# per_page: number of items to fetch per page
-# remote: data-remote
%li.page-item{ class: [active_when(page.current?), ('sibling' if page.next? || page.prev?)] }
%li.page-item{ class: [active_when(page.current?), ('sibling' if page.next? || page.prev?)], data: { test: 'page' } }
= link_to page, url, { remote: remote, rel: page.next? ? 'next' : page.prev? ? 'prev' : nil, class: 'page-link' }
......@@ -45,7 +45,7 @@ describe "Admin::AbuseReports", :js do
visit admin_abuse_reports_path
expect(page).to have_selector('.pagination')
expect(page).to have_selector('.pagination .page', count: (report_count.to_f / AbuseReport.default_per_page).ceil)
expect(page).to have_selector('.pagination [data-test=page]', count: (report_count.to_f / AbuseReport.default_per_page).ceil)
end
end
end
......
Markdown is supported
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