Skip to content

Commit

Permalink
feedback: rename no trips/service states
Browse files Browse the repository at this point in the history
  • Loading branch information
thecristen committed Nov 2, 2023
1 parent 9834fff commit 109c445
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 16 deletions.
6 changes: 3 additions & 3 deletions apps/site/assets/ts/stop/__tests__/DepartureListTest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ describe("DepartureList", () => {
).toBeDefined();
});

it("should render `No upcoming trips today` if there are no schedules", () => {
it("should render `No more trips today` if there are no schedules", () => {
render(
<DepartureList
alerts={[]}
Expand All @@ -204,7 +204,7 @@ describe("DepartureList", () => {
hasService={true}
/>
);
expect(screen.getByText("No upcoming trips today")).toBeDefined();
expect(screen.getByText("No more trips today")).toBeDefined();
});

it("should display cancelled if the trip has been cancelled", () => {
Expand Down Expand Up @@ -308,7 +308,7 @@ describe("DepartureList", () => {
});

it("can show no service message", () => {
const expectedMessage = "No service today";
const expectedMessage = "No trips today";
render(
<DepartureList
route={route}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ exports[`StopPageDepartures renders with data 2`] = `
<div
class="font-helvetica-neue fs-14 u-nowrap"
>
No upcoming trips
No more trips today
</div>
</div>
<div>
Expand All @@ -115,7 +115,7 @@ exports[`StopPageDepartures renders with data 2`] = `
<div
class="font-helvetica-neue fs-14 u-nowrap"
>
No upcoming trips
No more trips today
</div>
</div>
<div>
Expand All @@ -142,7 +142,7 @@ exports[`StopPageDepartures renders with data 2`] = `
<div
class="font-helvetica-neue fs-14 u-nowrap"
>
No upcoming trips
No more trips today
</div>
</div>
<div>
Expand Down Expand Up @@ -191,7 +191,7 @@ exports[`StopPageDepartures renders with data 2`] = `
<div
class="font-helvetica-neue fs-14 u-nowrap"
>
No upcoming trips
No more trips today
</div>
</div>
<div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ describe("DepartureTimes", () => {
});
});

it("renders 'No upcoming trips' when no predictions or schedules", async () => {
it("renders 'No more trips' when no predictions or schedules", async () => {
renderWithRouter(
<DepartureTimes
headsign="Alewife"
Expand All @@ -471,7 +471,7 @@ describe("DepartureTimes", () => {
/>
);
await waitFor(() => {
expect(screen.getByText("No upcoming trips")).toBeDefined();
expect(screen.getByText("No more trips today")).toBeDefined();
expect(screen.getByText("Alewife")).toBeDefined();
});
});
Expand Down Expand Up @@ -524,7 +524,7 @@ describe("DepartureTimes", () => {
});

it("can show no service message", async () => {
const expectedMessage = "No service today";
const expectedMessage = "No trips today";
renderWithRouter(
<DepartureTimes
headsign="Some place"
Expand Down
6 changes: 2 additions & 4 deletions apps/site/assets/ts/stop/components/DepartureList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ interface DepartureListProps {
}

const displayNoUpcomingTrips = (
message = "No upcoming trips today"
message = "No more trips today"
): JSX.Element => {
return (
<div className="c-alert-item--low m-8 d-flex justify-content-center align-items-center pb-40 pt-40">
Expand Down Expand Up @@ -59,9 +59,7 @@ const DepartureList = ({

const noTrips =
modeSpecificDepartures.length === 0 && displayNoUpcomingTrips();
const noService =
!hasService &&
displayNoUpcomingTrips(`No service today, ${todayDateString()}`);
const noService = !hasService && displayNoUpcomingTrips("No trips today");
const noServiceOrNoTrips = noService || noTrips;

return (
Expand Down
4 changes: 2 additions & 2 deletions apps/site/assets/ts/stop/components/DepartureTimes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ const DepartureTimes = ({
<div className="departure-card__times">{timeList}</div>
) : (
<div className="font-helvetica-neue fs-14 u-nowrap">
No upcoming trips
No more trips today
</div>
)}
</DeparturesWithBadge>
) : (
<div className="font-helvetica-neue fs-14 u-nowrap">
No service today
No trips today
</div>
)}
</div>
Expand Down

0 comments on commit 109c445

Please sign in to comment.