Add skip links to readinglist, podcasts, and listings (#12769)

* add skip link functionality to readinglist, listings and podcasts

* fix initscrolling reference to podcasts
This commit is contained in:
Suzanne Aitchison 2021-02-23 08:33:26 +00:00 committed by GitHub
parent acb79a2cf2
commit 5abe88c69b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 8 deletions

View file

@ -375,7 +375,7 @@ function fetchNextPageIfNearBottom() {
var scrollableElem;
if (indexWhich === 'podcast-episodes') {
scrollableElem = document.getElementById('articles-list');
scrollableElem = document.getElementById('main-content');
fetchCallback = function fetch() {
fetchNextPodcastPage(indexContainer);
};

View file

@ -13,7 +13,7 @@ export const AllListings = ({
loadNextPage,
}) => {
return (
<main class="crayons-layout__content">
<main class="crayons-layout__content" id="main-content">
<div className="listings-columns" id="listings-results">
{listings.map((listing) => (
<SingleListing

View file

@ -220,7 +220,7 @@ export class ReadingList extends Component {
onClick={this.toggleTag}
/>
<main className="crayons-layout__content">
<main className="crayons-layout__content" id="main-content">
<div className="crayons-card mb-4">
{items.length > 0 ? itemsToRender : this.renderEmptyItems()}
</div>

View file

@ -19,7 +19,7 @@
data-feed="<%= params[:timeframe] || "base-feed" %>"
data-articles-since="<%= Timeframe.datetime_iso8601(params[:timeframe]) %>">
<%= render "podcast_episodes/sidebar" %>
<div class="articles-list" id="articles-list">
<main class="articles-list" id="main-content">
<div class="substories" id="substories">
<% if @podcast_episodes %>
<%= render "podcast_episodes/episodes_feed" %>

View file

@ -12,7 +12,7 @@ RSpec.describe "User visits /pod page", type: :system do
before { visit "/pod" }
it "displays the podcasts", js: true do
within "#articles-list" do
within "#main-content" do
expect(page).to have_link(nil, href: podcast_episode1.path)
expect(page).to have_link(nil, href: podcast_episode2.path)
expect(page).to have_link(nil, href: podcast_episode3.path)
@ -20,20 +20,20 @@ RSpec.describe "User visits /pod page", type: :system do
end
it "displays the podcasts with published_at" do
within "#articles-list" do
within "#main-content" do
expect(page).to have_selector("time.published-at", count: 2)
expect(page).to have_selector("span.time-ago-indicator-initial-placeholder", count: 2)
end
end
it "doesn't display an unreachable podcast" do
within "#articles-list" do
within "#main-content" do
expect(page).not_to have_link(nil, href: un_podcast_episode.path)
end
end
it "doesn't dsplay a podcast that is not published" do
within "#articles-list" do
within "#main-content" do
expect(page).not_to have_link(nil, href: unpublished_episode.path)
end
end