UI调整
This commit is contained in:
@@ -57,9 +57,14 @@ test("React card variants preserve watch URLs, episode gates, badges and linked
|
||||
card,
|
||||
/href="\/drama\/都市%20剧\/"|href="\/drama\/%E9%83%BD%E5%B8%82%20%E5%89%A7\/"/,
|
||||
);
|
||||
// Episode count and serial state sit in the cover corner; the line under the title lists genres.
|
||||
assert.match(
|
||||
card,
|
||||
/<p class="hk-drama-card__meta hk-drama-card__meta--ep"><span class="hk-drama-card__meta-ep" data-status="serial">连载 · 8 集<\/span><span class="hk-drama-card__meta-tags">/,
|
||||
/<span class="hk-drama-card__eps" data-status="serial"><b>8<\/b> 集 · 连更<\/span><\/a>/,
|
||||
);
|
||||
assert.match(
|
||||
card,
|
||||
/<p class="hk-drama-card__meta hk-drama-card__genres"><a href="\/tags\/romance\/">爱情<\/a><span class="hk-drama-card__genre-sep" aria-hidden="true">\/<\/span>/,
|
||||
);
|
||||
assert.doesNotMatch(card, /hk-drama-card__ep"/);
|
||||
assert.match(card, /hk-badge hk-badge--hot/);
|
||||
@@ -72,7 +77,7 @@ test("React card variants preserve watch URLs, episode gates, badges and linked
|
||||
<PlayRecommendationCard item={item} />,
|
||||
);
|
||||
assert.match(recommendation, /hk-drama-card hk-drama-card--play/);
|
||||
assert.match(recommendation, /hk-drama-card__meta-ep" data-status="serial">连载 · 8 集</);
|
||||
assert.match(recommendation, /hk-drama-card__eps" data-status="serial"><b>8<\/b> 集 · 连更</);
|
||||
assert.doesNotMatch(recommendation, /hk-badge--hot/);
|
||||
const video = renderToStaticMarkup(
|
||||
<SeriesCard
|
||||
|
||||
@@ -90,10 +90,15 @@ test("React tags and list pages preserve the original Go catalog content and nav
|
||||
const actual = main(renderPage(Component, data)),
|
||||
expected = main(fixture(name + "-go.html"));
|
||||
assert.ok(actual, name);
|
||||
// The episode label moved from the cover link into the meta-row chip.
|
||||
const coverEpisode = /^(?:全 \d+ 集|更新至 \d+ 集|连载中|已完结)$/;
|
||||
// Both sites label episodes on the cover link, in different wording; compare those links without the label.
|
||||
const coverEpisode = /^(?:全 \d+ 集|更新至 \d+ 集|连载中|已完结)$/,
|
||||
coverBadge = /^(?:\d+ 集 · )?(?:连更|完结)$/;
|
||||
assert.deepEqual(
|
||||
anchors(actual),
|
||||
anchors(actual).map((link) =>
|
||||
link.href.startsWith("/drama/") && coverBadge.test(link.text)
|
||||
? { ...link, text: "" }
|
||||
: link,
|
||||
),
|
||||
anchors(expected).map((link) =>
|
||||
link.href.startsWith("/drama/") && coverEpisode.test(link.text)
|
||||
? { ...link, text: "" }
|
||||
@@ -112,7 +117,7 @@ test("React tags and list pages preserve the original Go catalog content and nav
|
||||
name + " ad placement",
|
||||
);
|
||||
assert.match(actual, /花魁 & 第一部/);
|
||||
assert.match(actual, /<span class="hk-drama-card__meta-ep" data-status="done">完结 · 4 集<\/span>/);
|
||||
assert.match(actual, /<span class="hk-drama-card__eps" data-status="done"><b>4<\/b> 集 · 完结<\/span>/);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user