From 6bf0a5cb5034a7e684dcc3500e841785237ce2dd Mon Sep 17 00:00:00 2001
From: Daniel Baumann <daniel.baumann@progress-linux.org>
Date: Sun, 7 Apr 2024 19:32:43 +0200
Subject: Adding upstream version 1:115.7.0.

Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
---
 .../unit/content-src/components/Topics.test.jsx    | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100644 browser/components/newtab/test/unit/content-src/components/Topics.test.jsx

(limited to 'browser/components/newtab/test/unit/content-src/components/Topics.test.jsx')

diff --git a/browser/components/newtab/test/unit/content-src/components/Topics.test.jsx b/browser/components/newtab/test/unit/content-src/components/Topics.test.jsx
new file mode 100644
index 0000000000..91d15c5d4e
--- /dev/null
+++ b/browser/components/newtab/test/unit/content-src/components/Topics.test.jsx
@@ -0,0 +1,22 @@
+import { Topic, Topics } from "content-src/components/Topics/Topics";
+import React from "react";
+import { shallow } from "enzyme";
+
+describe("<Topics>", () => {
+  it("should render a Topics element", () => {
+    const wrapper = shallow(<Topics topics={[]} />);
+    assert.ok(wrapper.exists());
+  });
+  it("should render a Topic element for each topic with the right url", () => {
+    const data = [
+      { name: "topic1", url: "https://topic1.com" },
+      { name: "topic2", url: "https://topic2.com" },
+    ];
+
+    const wrapper = shallow(<Topics topics={data} />);
+
+    const topics = wrapper.find(Topic);
+    assert.lengthOf(topics, 2);
+    topics.forEach((topic, i) => assert.equal(topic.props().url, data[i].url));
+  });
+});
-- 
cgit v1.2.3

