Skip to content

Commit

Permalink
Revert "Use bundled bootstrap.min.css (#145)"
Browse files Browse the repository at this point in the history
See #148
  • Loading branch information
snazy committed Jul 11, 2024
1 parent 1d35c77 commit e7d6a85
Show file tree
Hide file tree
Showing 14 changed files with 48 additions and 42 deletions.
8 changes: 8 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link href="%PUBLIC_URL%/manifest.json" rel="manifest"/>

<link
crossorigin="anonymous"
href="https://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"
integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh"
rel="stylesheet"
/>

<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons" />

<!--
Expand Down
16 changes: 8 additions & 8 deletions src/App.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ it("ExploreTree renders", async () => {
const { getByText, asFragment } = render(
<MemoryRouter initialEntries={["/tree/main"]}>
<App />
</MemoryRouter>,
</MemoryRouter>
);
expect(asFragment()).toMatchSnapshot();
await waitFor(() => getByText("Commit History"));
Expand All @@ -61,7 +61,7 @@ it("ExploreTree renders", async () => {
expect(asFragment()).toMatchSnapshot();
expect(screen.getByText("a").closest("a")).toHaveAttribute(
"href",
"/tree/main/a",
"/tree/main/a"
);
});

Expand Down Expand Up @@ -101,7 +101,7 @@ it("ExploreTree renders commit", async () => {
const { getByText, asFragment } = render(
<MemoryRouter initialEntries={["/commits/main"]}>
<App />
</MemoryRouter>,
</MemoryRouter>
);
expect(asFragment()).toMatchSnapshot();
await waitFor(() => getByText("deadbeef"));
Expand All @@ -112,7 +112,7 @@ it("ExploreTree renders commit", async () => {
// expect(asFragment()).toMatchSnapshot();
expect(screen.getByText("commitMessage").closest("a")).toHaveAttribute(
"href",
"/commits/main/deadbeef",
"/commits/main/deadbeef"
);
});

Expand Down Expand Up @@ -152,7 +152,7 @@ it("ExploreTree renders commit message", async () => {
const { getByText, asFragment } = render(
<MemoryRouter initialEntries={["/commits/main/deadbeef"]}>
<App />
</MemoryRouter>,
</MemoryRouter>
);
expect(asFragment()).toMatchSnapshot();
await waitFor(() => getByText("sally"));
Expand All @@ -173,7 +173,7 @@ it("ExploreTree renders with slug", async () => {

const scope1 = nock("http://localhost/api/v1")
.get(
"/trees/tree/main/entries?filter=entry.namespace.matches(%27%5Ea(%5C%5C.%7C%24)%27)&namespaceDepth=2",
"/trees/tree/main/entries?filter=entry.namespace.matches(%27%5Ea(%5C%5C.%7C%24)%27)&namespaceDepth=2"
)
.reply(200, { token: "foo", entries: [entry] });
const scope2 = nock("http://localhost/api/v1")
Expand All @@ -194,7 +194,7 @@ it("ExploreTree renders with slug", async () => {
const { getByText, asFragment } = render(
<MemoryRouter initialEntries={["/tree/main/a"]}>
<App />
</MemoryRouter>,
</MemoryRouter>
);
expect(asFragment()).toMatchSnapshot();
await waitFor(() => getByText("a"));
Expand All @@ -205,7 +205,7 @@ it("ExploreTree renders with slug", async () => {
expect(asFragment()).toMatchSnapshot();
expect(screen.getByText("b").closest("a")).toHaveAttribute(
"href",
"/tree/main/a/b",
"/tree/main/a/b"
);
});

Expand Down
2 changes: 1 addition & 1 deletion src/CommitDetails/CommitDetails.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ it("Commit details renders", async () => {
/>
</Routes>
</MemoryRouter>
</React.StrictMode>,
</React.StrictMode>
);
await waitFor(() => getByText("commitMessage"));
expect(asFragment()).toMatchSnapshot();
Expand Down
2 changes: 1 addition & 1 deletion src/CommitHeader/CommitHeader.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ it("CommitHeader renders", async () => {
const { getByText, asFragment } = render(
<React.StrictMode>
<CommitHeader currentRef={"main"} />
</React.StrictMode>,
</React.StrictMode>
);
expect(asFragment()).toMatchSnapshot();
await waitFor(() => getByText("deadbeef"));
Expand Down
2 changes: 1 addition & 1 deletion src/CommitHeader/CommitHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const CommitHeader = (props: { currentRef: string }): React.ReactElement => {
{prettyMilliseconds(
new Date().getTime() -
(currentLog.commitMeta.commitTime ?? new Date(0)).getTime(),
{ compact: true },
{ compact: true }
)}
</span>
</span>
Expand Down
6 changes: 3 additions & 3 deletions src/CommitLog/CommitLog.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ it("Commit log renders", async () => {
/>
</Routes>
</MemoryRouter>
</React.StrictMode>,
</React.StrictMode>
);
// disable snapshots w/ unique ids until https://github.com/facebook/jest/issues/8618 is fixed
// expect(asFragment()).toMatchSnapshot();
Expand Down Expand Up @@ -96,13 +96,13 @@ it("Commit redirects on an invalid ref", async () => {
/>
<Route path={"/notfound"} element={<ShowPath />} />
</Routes>
</MemoryRouter>,
</MemoryRouter>
);
expect(asFragment()).toMatchSnapshot();
await waitFor(() =>
getAllByText((content, element) => {
return element?.tagName.toLowerCase() === "div";
}),
})
);

expect(asFragment()).toMatchSnapshot();
Expand Down
16 changes: 8 additions & 8 deletions src/ContentView/ContentView.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ import { Content } from "../utils";
it("Render Iceberg Content", async () => {
const scope = nock("http://localhost/api/v1")
.get(
"/contents?hashOnRef=55cc2e40cbe2eed190f3987c53ffc34643d5cfa5ef878392d88b2eb4137e92e4&ref=dev",
"/contents?hashOnRef=55cc2e40cbe2eed190f3987c53ffc34643d5cfa5ef878392d88b2eb4137e92e4&ref=dev"
)
.reply(200, { contentList });
const { getByAltText, asFragment } = render(
<BrowserRouter>
<ContentView tableContent={icebergTableContent} />
</BrowserRouter>,
</BrowserRouter>
);
expect(asFragment()).toMatchSnapshot();
await waitFor(() => getByAltText("IcebergTable"));
Expand All @@ -41,20 +41,20 @@ it("Render Iceberg Content", async () => {
expect(asFragment()).toMatchSnapshot();
expect(screen.getByAltText("IcebergTable")).toHaveAttribute(
"src",
"/iceberg.png",
"/iceberg.png"
);
});

it("Render DeltaLake Content", async () => {
const scope = nock("http://localhost/api/v1")
.get(
"/contents?hashOnRef=55cc2e40cbe2eed190f3987c53ffc34643d5cfa5ef878392d88b2eb4137e92e4&ref=dev",
"/contents?hashOnRef=55cc2e40cbe2eed190f3987c53ffc34643d5cfa5ef878392d88b2eb4137e92e4&ref=dev"
)
.reply(200, { contentList });
const { getByAltText, asFragment } = render(
<BrowserRouter>
<ContentView tableContent={deltaLakeContent} />
</BrowserRouter>,
</BrowserRouter>
);
expect(asFragment()).toMatchSnapshot();
await waitFor(() => getByAltText("IcebergTable"));
Expand All @@ -64,20 +64,20 @@ it("Render DeltaLake Content", async () => {
expect(asFragment()).toMatchSnapshot();
expect(screen.getByAltText("IcebergTable")).toHaveAttribute(
"src",
"/delta.png",
"/delta.png"
);
});

it("Render Iceberg View Content", async () => {
const scope = nock("http://localhost/api/v1")
.get(
"/contents?hashOnRef=55cc2e40cbe2eed190f3987c53ffc34643d5cfa5ef878392d88b2eb4137e92e4&ref=dev",
"/contents?hashOnRef=55cc2e40cbe2eed190f3987c53ffc34643d5cfa5ef878392d88b2eb4137e92e4&ref=dev"
)
.reply(200, { contentList });
const { getByText, asFragment } = render(
<BrowserRouter>
<ContentView tableContent={icebergViewContent} />
</BrowserRouter>,
</BrowserRouter>
);
expect(asFragment()).toMatchSnapshot();
await waitFor(() => getByText("ICEBERG_VIEW"));
Expand Down
4 changes: 2 additions & 2 deletions src/Contents/Contents.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ it("TableListing renders object", async () => {
<Route path={"/tree/:branch"} element={<TableListing />} />
</Routes>
</MemoryRouter>
</React.StrictMode>,
</React.StrictMode>
);
expect(asFragment()).toMatchSnapshot();
await waitFor(() => getByText("b"));
Expand All @@ -44,6 +44,6 @@ it("TableListing renders object", async () => {
expect(asFragment()).toMatchSnapshot();
expect(screen.getByText("b").closest("a")).toHaveAttribute(
"href",
"/content/main/b",
"/content/main/b"
);
});
8 changes: 4 additions & 4 deletions src/ExploreLink/ExploreLink.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ it("ExploreLink renders with container", () => {
<ExploreLink path={["a", "b", "c"]} toRef={"main"}>
xxx
</ExploreLink>
</BrowserRouter>,
</BrowserRouter>
);

expect(asFragment()).toMatchSnapshot();
expect(screen.getByText("xxx").closest("a")).toHaveAttribute(
"href",
"/tree/main/a/b/c",
"/tree/main/a/b/c"
);
});

Expand All @@ -43,12 +43,12 @@ it("ExploreLink renders with object", () => {
xxx
</ExploreLink>
</BrowserRouter>
</React.StrictMode>,
</React.StrictMode>
);

expect(asFragment()).toMatchSnapshot();
expect(screen.getByText("xxx").closest("a")).toHaveAttribute(
"href",
"/content/main/",
"/content/main/"
);
});
2 changes: 1 addition & 1 deletion src/NotFound/NotFound.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ it("Test not found", async () => {
render(
<BrowserRouter>
<NotFound />
</BrowserRouter>,
</BrowserRouter>
);
await screen.findByText("404 - Not found");
});
12 changes: 6 additions & 6 deletions src/TableHead/TableHead.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ it("TableHead renders with path", () => {
}
/>
</Routes>
</MemoryRouter>,
</MemoryRouter>
);

expect(asFragment()).toMatchSnapshot();
expect(screen.getByText("c").closest("a")).toHaveAttribute(
"href",
"/tree/main/a/b/c",
"/tree/main/a/b/c"
);
});

Expand All @@ -64,7 +64,7 @@ it("TableHead renders without path", () => {
}
/>
</Routes>
</MemoryRouter>,
</MemoryRouter>
);

expect(asFragment()).toMatchSnapshot();
Expand All @@ -90,7 +90,7 @@ it("TableHead renders without current ref", () => {
/>
</Route>
</Routes>
</MemoryRouter>,
</MemoryRouter>
);

expect(asFragment()).toMatchSnapshot();
Expand All @@ -112,7 +112,7 @@ it("CommitHead renders with current ref", () => {
}
/>
</Routes>
</MemoryRouter>,
</MemoryRouter>
);

expect(asFragment()).toMatchSnapshot();
Expand All @@ -134,7 +134,7 @@ it("TableHead renders with different current ref", () => {
}
/>
</Routes>
</MemoryRouter>,
</MemoryRouter>
);

expect(asFragment()).toMatchSnapshot();
Expand Down
8 changes: 4 additions & 4 deletions src/TableListing/TableListing.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ it("TableListing renders", async () => {
<Routes>
<Route path={"/tree/:branch"} element={<TableListing />} />
</Routes>
</MemoryRouter>,
</MemoryRouter>
);
expect(asFragment()).toMatchSnapshot();
await waitFor(() => getByText("a"));
Expand All @@ -49,7 +49,7 @@ it("TableListing renders", async () => {
expect(asFragment()).toMatchSnapshot();
expect(screen.getByText("a").closest("a")).toHaveAttribute(
"href",
"/tree/main/a",
"/tree/main/a"
);
});

Expand All @@ -64,13 +64,13 @@ it("TableListing redirects on an invalid ref", async () => {
<Route path="/tree/:branch" element={<TableListing />} />
<Route path={"/notfound"} element={<ShowPath />} />
</Routes>
</MemoryRouter>,
</MemoryRouter>
);
expect(asFragment()).toMatchSnapshot();
await waitFor(() =>
getAllByText((content, element) => {
return element?.tagName.toLowerCase() === "div";
}),
})
);

scope.isDone();
Expand Down
2 changes: 0 additions & 2 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
*/
import React from "react";
import ReactDOM from "react-dom";
// eslint-disable-next-line import/no-internal-modules
import "bootstrap/dist/css/bootstrap.min.css";
import "./index.css";
import { BrowserRouter as Router } from "react-router-dom";
import { App } from "./App";
Expand Down
2 changes: 1 addition & 1 deletion src/setupProxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ app.use(
createProxyMiddleware({
target: "http://localhost:19120",
changeOrigin: true,
}),
})
);
app.listen(3000);

0 comments on commit e7d6a85

Please sign in to comment.