Skip to content

Commit 7d04721

Browse files
Merge pull request #84 from ISISComputingGroup/show_runstate_on_instruments_page
show runstate on instruments page
2 parents 726f733 + 609df6e commit 7d04721

37 files changed

+1410
-549
lines changed

app/Footer.test.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { render } from "@testing-library/react";
2+
import Footer from "@/app/Footer";
3+
4+
it("renders footer unchanged", () => {
5+
const { container } = render(<Footer />);
6+
expect(container).toMatchSnapshot();
7+
});

app/Footer.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import Image from "next/image";
44

55
export default function Footer() {
66
return (
7-
<section className="bg-white dark:bg-zinc-900 ">
7+
<footer className="bg-white dark:bg-zinc-900 ">
88
<div className="max-w-screen-xl px-4 py-12 mx-auto space-y-8 overflow-hidden sm:px-6 lg:px-8 w-full flex flex-col justify-center items-center ">
99
<Link href="/" className="flex items-center justify-center ">
1010
<Image
@@ -40,6 +40,6 @@ export default function Footer() {
4040
© 2024 Experiment Controls at ISIS. All rights reserved.
4141
</p>
4242
</div>
43-
</section>
43+
</footer>
4444
);
4545
}

app/Navbar.test.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { render } from "@testing-library/react";
2+
import NavBar from "@/app/NavBar";
3+
4+
it("renders navbar unchanged", () => {
5+
const { container } = render(<NavBar />);
6+
expect(container).toMatchSnapshot();
7+
});
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`renders footer unchanged 1`] = `
4+
<div>
5+
<footer
6+
class="bg-white dark:bg-zinc-900 "
7+
>
8+
<div
9+
class="max-w-screen-xl px-4 py-12 mx-auto space-y-8 overflow-hidden sm:px-6 lg:px-8 w-full flex flex-col justify-center items-center "
10+
>
11+
<a
12+
class="flex items-center justify-center "
13+
href="/"
14+
>
15+
<img
16+
alt="IBEX Logo"
17+
class="h-16 w-auto"
18+
data-nimg="1"
19+
decoding="async"
20+
height="128"
21+
loading="lazy"
22+
src="/_next/image?url=%2FWebDashboard%2FIBEX_logo.png&w=256&q=75"
23+
srcset="/_next/image?url=%2FWebDashboard%2FIBEX_logo.png&w=128&q=75 1x, /_next/image?url=%2FWebDashboard%2FIBEX_logo.png&w=256&q=75 2x"
24+
style="color: transparent;"
25+
width="128"
26+
/>
27+
</a>
28+
<nav
29+
class="flex flex-wrap justify-center -mx-5 -my-2"
30+
>
31+
<a
32+
class="text-base leading-6 text-gray-500 hover:text-gray-900 dark:text-white dark:hover:text-gray-400 transition-color duration-100 px-5 py-2"
33+
href="/"
34+
>
35+
Home
36+
</a>
37+
<a
38+
class="text-base leading-6 text-gray-500 hover:text-gray-900 dark:text-white dark:hover:text-gray-400 transition-color duration-100 px-5 py-2"
39+
href="/instruments"
40+
>
41+
Instrument statuses
42+
</a>
43+
<a
44+
class="text-base leading-6 text-gray-500 hover:text-gray-900 dark:text-white dark:hover:text-gray-400 transition-color duration-100 px-5 py-2"
45+
href="https://www.isis.stfc.ac.uk/Pages/Beam-Status.aspx"
46+
target="_blank"
47+
>
48+
Beam status
49+
</a>
50+
</nav>
51+
<p
52+
class="mt-8 text-base leading-6 text-center text-gray-400"
53+
>
54+
© 2024 Experiment Controls at ISIS. All rights reserved.
55+
</p>
56+
</div>
57+
</footer>
58+
</div>
59+
`;
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`renders navbar unchanged 1`] = `
4+
<div>
5+
<header
6+
class="items-center bg-white dark:bg-zinc-900 py-4 px-8 shadow-xl justify-between sm:flex hidden"
7+
>
8+
<a
9+
aria-label="Home"
10+
class="flex items-center gap-4 bg-white dark:bg-[#18171e] rounded-lg px-4"
11+
href="/"
12+
>
13+
<img
14+
alt="IBEX Logo"
15+
class="h-16 w-auto"
16+
data-nimg="1"
17+
decoding="async"
18+
height="100"
19+
loading="lazy"
20+
src="/_next/image?url=%2FWebDashboard%2FIBEX_logo.png&w=256&q=75"
21+
srcset="/_next/image?url=%2FWebDashboard%2FIBEX_logo.png&w=128&q=75 1x, /_next/image?url=%2FWebDashboard%2FIBEX_logo.png&w=256&q=75 2x"
22+
style="color: transparent;"
23+
width="100"
24+
/>
25+
<h1
26+
class="text-black dark:text-white font-bold text-2xl"
27+
>
28+
Web Dashboard
29+
</h1>
30+
</a>
31+
<div
32+
class="md:flex hidden gap-2"
33+
>
34+
<a
35+
class="block py-2 px-3 rounded text-black dark:text-white hover:text-white hover:bg-zinc-800"
36+
href="/"
37+
>
38+
Home
39+
</a>
40+
<a
41+
class="block py-2 px-3 rounded text-black dark:text-white hover:text-white hover:bg-zinc-800"
42+
href="/instruments"
43+
>
44+
Instrument Status
45+
</a>
46+
<a
47+
class="block py-2 px-3 rounded text-black dark:text-white hover:text-white hover:bg-zinc-800"
48+
href="https://www.isis.stfc.ac.uk/Pages/Beam-Status.aspx"
49+
target="_blank"
50+
>
51+
Beam status
52+
</a>
53+
<a
54+
class="block py-2 px-3 rounded text-black dark:text-white hover:text-white hover:bg-zinc-800"
55+
href="https://github.com/ISISComputingGroup/WebDashboard"
56+
>
57+
<svg
58+
class="fill-current w-6 h-6"
59+
viewBox="0 0 24 24"
60+
xmlns="http://www.w3.org/2000/svg"
61+
>
62+
<path
63+
d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"
64+
/>
65+
</svg>
66+
</a>
67+
</div>
68+
</header>
69+
</div>
70+
`;

0 commit comments

Comments
 (0)