Skip to content

Commit

Permalink
tweak: The detours dropdown should totally be behind DetoursOnLadder …
Browse files Browse the repository at this point in the history
…flag
  • Loading branch information
hannahpurcell committed Feb 14, 2025
1 parent b8b3f65 commit 31c77c6
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 17 deletions.
14 changes: 7 additions & 7 deletions assets/src/components/routeLadder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export const Header = ({
hasAlert && "c-route-ladder__dropdown--non-skate-alert",
])}
>
{isAdmin && (
{(isAdmin || inTestGroup(TestGroups.DetoursOnLadder)) && (
<Dropdown className="border-box inherit-box">
<Dropdown.Toggle
className="c-route-ladder__dropdown-button d-flex"
Expand Down Expand Up @@ -116,7 +116,7 @@ export const Header = ({
)}
{hasAlert && (
<>
<Dropdown.Divider className="border-top-0" />
{isAdmin && <Dropdown.Divider className="border-top-0" />}
<Dropdown.Header>
<div className="c-route-ladder__dropdown-header-text">
Active detours
Expand Down Expand Up @@ -148,11 +148,11 @@ export const Header = ({
)}
</>
)}
{/* {!hasAlert && (
<Dropdown.ItemText className="lh-base pb-4">
No active detours
</Dropdown.ItemText>
)} */}
{!hasAlert && inTestGroup(TestGroups.DetoursOnLadder) && (
<Dropdown.ItemText className="lh-base pb-4">
No active detours
</Dropdown.ItemText>
)}
</Dropdown.Menu>
</Dropdown>
)}
Expand Down
16 changes: 8 additions & 8 deletions assets/tests/components/__snapshots__/routeLadder.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ exports[`routeLadder displays loading if we are fetching the timepoints 1`] = `
/>
<div
class="c-route-pill c-route-pill--bus c-route-pill--large-format c-route-pill--dynamic-size"
id="route-pill:ru:"
id="route-pill:r11:"
>
28
</div>
Expand Down Expand Up @@ -59,7 +59,7 @@ exports[`routeLadder displays no crowding data for a bus coming off a route with
/>
<div
class="c-route-pill c-route-pill--bus c-route-pill--large-format c-route-pill--dynamic-size"
id="route-pill:rq:"
id="route-pill:rt:"
>
28
</div>
Expand Down Expand Up @@ -328,7 +328,7 @@ exports[`routeLadder doesn't display crowding data for a vehicle coming off a ro
/>
<div
class="c-route-pill c-route-pill--bus c-route-pill--large-format c-route-pill--dynamic-size"
id="route-pill:rs:"
id="route-pill:rv:"
>
28
</div>
Expand Down Expand Up @@ -540,7 +540,7 @@ exports[`routeLadder doesn't render a bus that's off-course but nonrevenue 1`] =
/>
<div
class="c-route-pill c-route-pill--bus c-route-pill--large-format c-route-pill--dynamic-size"
id="route-pill:ro:"
id="route-pill:rr:"
>
28
</div>
Expand Down Expand Up @@ -856,7 +856,7 @@ exports[`routeLadder renders a route ladder with crowding instead of vehicles 1`
/>
<div
class="c-route-pill c-route-pill--bus c-route-pill--large-format c-route-pill--dynamic-size"
id="route-pill:rm:"
id="route-pill:rp:"
>
28
</div>
Expand Down Expand Up @@ -1129,7 +1129,7 @@ exports[`routeLadder renders a route ladder with laying over vehicles 1`] = `
/>
<div
class="c-route-pill c-route-pill--bus c-route-pill--large-format c-route-pill--dynamic-size"
id="route-pill:rk:"
id="route-pill:rn:"
>
28
</div>
Expand Down Expand Up @@ -1647,7 +1647,7 @@ exports[`routeLadder renders a route ladder with vehicles 1`] = `
/>
<div
class="c-route-pill c-route-pill--bus c-route-pill--large-format c-route-pill--dynamic-size"
id="route-pill:rg:"
id="route-pill:rj:"
>
28
</div>
Expand Down Expand Up @@ -1951,7 +1951,7 @@ exports[`routeLadder renders a route ladder with vehicles in the incoming box 1`
/>
<div
class="c-route-pill c-route-pill--bus c-route-pill--large-format c-route-pill--dynamic-size"
id="route-pill:ri:"
id="route-pill:rl:"
>
28
</div>
Expand Down
5 changes: 3 additions & 2 deletions assets/tests/components/routeLadder.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -367,8 +367,9 @@ describe("routeLadder", () => {
expect(screen.getByText("Add detour")).toBeVisible()
})

// eslint-disable-next-line jest/no-disabled-tests
test.skip("does not render 'Add detour' in the dropdown if not an admin", async () => {
test("does not render 'Add detour' in the dropdown if not an admin", async () => {
jest.mocked(getTestGroups).mockReturnValue([TestGroups.DetoursOnLadder])

const route: Route = routeFactory.build({
id: "28",
name: "28",
Expand Down

0 comments on commit 31c77c6

Please sign in to comment.