-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IOCOM-1370, IOCOM-1371] Selectable service name in message details (…
…both standard and SEND), new DS (#5757) ## Short description This PR makes the service name selectable on the message details' screen, with the new DS on both standard and SEND messages (selection leads to service details' screen). |Standard message|SEND message| |-|-| |![Simulator Screenshot - iPhone 15 - 2024-05-09 at 15 26 25](https://github.com/pagopa/io-app/assets/5150343/1e955740-252b-4fb2-92f8-0f6586550458)|![Simulator Screenshot - iPhone 15 - 2024-05-09 at 15 26 34](https://github.com/pagopa/io-app/assets/5150343/ba799363-3d85-4606-92fe-0814bbde7f38)| ## List of changes proposed in this pull request - `OrganizationHeader` implements the `onPress` event on the service name, leading to the service details' screen - `MessageDetailsHeader` adds the `serviceId` parameter to `OrganizationHeader` component ## How to test Using the io-dev-api-server, check that both standard and SEND messages have a selectable service name that leads to the service details' screen
- Loading branch information
Showing
7 changed files
with
514 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 31 additions & 6 deletions
37
ts/features/messages/components/MessageDetail/__tests__/OrganizationHeader.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,41 @@ | ||
import React from "react"; | ||
import { render } from "@testing-library/react-native"; | ||
import { createStore } from "redux"; | ||
import { OrganizationHeader } from "../OrganizationHeader"; | ||
import { ServiceId } from "../../../../../../definitions/backend/ServiceId"; | ||
import { renderScreenWithNavigationStoreContext } from "../../../../../utils/testWrapper"; | ||
import { GlobalState } from "../../../../../store/reducers/types"; | ||
import { MESSAGES_ROUTES } from "../../../navigation/routes"; | ||
import { appReducer } from "../../../../../store/reducers"; | ||
import { preferencesDesignSystemSetEnabled } from "../../../../../store/actions/persistedPreferences"; | ||
import { applicationChangeState } from "../../../../../store/actions/application"; | ||
|
||
describe("OrganizationHeader component", () => { | ||
it("should match the snapshot", () => { | ||
const component = render( | ||
const component = renderComponent(); | ||
expect(component.toJSON()).toMatchSnapshot(); | ||
}); | ||
}); | ||
|
||
const renderComponent = () => { | ||
const serviceId = "01HXEPR9JD8838JZDN3YD0EF0Z" as ServiceId; | ||
const initialState = appReducer(undefined, applicationChangeState("active")); | ||
const designSystemState = appReducer( | ||
initialState, | ||
preferencesDesignSystemSetEnabled({ isDesignSystemEnabled: true }) | ||
); | ||
const store = createStore(appReducer, designSystemState as any); | ||
|
||
return renderScreenWithNavigationStoreContext<GlobalState>( | ||
() => ( | ||
<OrganizationHeader | ||
logoUri={require("../../../../../../img/test/logo.png")} | ||
organizationName={"#### organization_name ####"} | ||
serviceName={"#### service name ####"} | ||
serviceId={serviceId} | ||
/> | ||
); | ||
expect(component.toJSON()).toMatchSnapshot(); | ||
}); | ||
}); | ||
), | ||
MESSAGES_ROUTES.MESSAGE_DETAIL, | ||
{}, | ||
store | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.