@times-components/ssr 2.58.3-alpha.2 → 2.58.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/__tests__/helpers/topic-helper.js +76 -0
- package/__tests__/integration/topic-default.js +4 -0
- package/__tests__/integration/topic-persisted-query.js +8 -0
- package/dist/article.react.bundle.js +4 -4
- package/dist/article.react.bundle.js.map +1 -1
- package/dist/author-profile.react.bundle.js +1 -1
- package/dist/author-profile.react.bundle.js.map +1 -1
- package/dist/common.react.bundle.js +9 -9
- package/dist/common.react.bundle.js.map +1 -1
- package/dist/topic.react.bundle.js +2 -0
- package/dist/topic.react.bundle.js.map +1 -0
- package/package.json +14 -13
- package/src/client/topic.js +27 -0
- package/src/component/topic.js +66 -0
- package/src/server/index.js +3 -1
- package/src/server/topic.js +61 -0
- package/src/standalone-renderer/app.js +34 -0
- package/src/standalone-renderer/page-init/topic.js +14 -0
- package/src/standalone-renderer/webpack.config.js +2 -1
- package/webpack.config.js +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [2.58.3](https://github.com/newsuk/times-components/compare/@times-components/ssr@2.58.2...@times-components/ssr@2.58.3) (2024-08-22)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @times-components/ssr
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## [2.58.2](https://github.com/newsuk/times-components/compare/@times-components/ssr@2.58.1...@times-components/ssr@2.58.2) (2024-08-14)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @times-components/ssr
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/* eslint-disable no-unused-expressions */
|
|
2
|
+
|
|
3
|
+
import { MockTopic, MockArticle } from "@times-components/fixture-generator";
|
|
4
|
+
import { terminalLog } from "../cypress/support";
|
|
5
|
+
|
|
6
|
+
export default (options = {}) => {
|
|
7
|
+
const qs = options.qs || "";
|
|
8
|
+
const variant = options.variant || "Default";
|
|
9
|
+
const topicPath = `/topic/canada`;
|
|
10
|
+
const pageUrl = `${topicPath}${qs}`;
|
|
11
|
+
|
|
12
|
+
describe(`Topic Page - ${variant}`, () => {
|
|
13
|
+
before(() => {
|
|
14
|
+
cy.task("startMockServerWith", {
|
|
15
|
+
Article: new MockArticle().get(),
|
|
16
|
+
Topic: new MockTopic().setTopicArticles(25).get()
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
beforeEach(() => {
|
|
21
|
+
cy.visit(pageUrl);
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
after(() => {
|
|
25
|
+
cy.task("stopMockServer");
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it("Topic head has required elements", () => {
|
|
29
|
+
cy.get("#main-container > div:nth-child(1)");
|
|
30
|
+
cy.get("#main-container h1")
|
|
31
|
+
.first()
|
|
32
|
+
.contains("Topic Page");
|
|
33
|
+
cy.get('div[data-testid="topic-description"]');
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
it("should take you to the article page once an article has been selected", () => {
|
|
37
|
+
cy.wait(2000);
|
|
38
|
+
cy.get(`div[data-testid="article-list-item-0"]`).click();
|
|
39
|
+
expect(cy.get('[data-testid="standfirst"]')).to.exist;
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
it("loads inline-ad", () => {
|
|
43
|
+
expect(cy.get("#ad-article-inline")).to.exist;
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it("navigates between article pages", () => {
|
|
47
|
+
cy.url().should("not.include", "?page=1");
|
|
48
|
+
cy.goToNextArticle();
|
|
49
|
+
cy.url().should("include", "?page=2");
|
|
50
|
+
cy.goToPreviousArticle();
|
|
51
|
+
cy.url().should("include", "?page=1");
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
it("should pass basic a11y test", () => {
|
|
55
|
+
cy.injectAxe();
|
|
56
|
+
cy.wait(1000);
|
|
57
|
+
cy.configureAxe({
|
|
58
|
+
rules: [
|
|
59
|
+
{
|
|
60
|
+
id: "color-contrast",
|
|
61
|
+
enabled: false
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
id: "region",
|
|
65
|
+
enabled: false
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
id: "heading-order",
|
|
69
|
+
enabled: false
|
|
70
|
+
}
|
|
71
|
+
]
|
|
72
|
+
});
|
|
73
|
+
cy.checkA11y(null, null, terminalLog, null);
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
};
|