Skip to content

Commit

Permalink
Merge pull request #1456 from companieshouse/bug/roe-2558-fix-broken-…
Browse files Browse the repository at this point in the history
…back-links

Fix/ROE-2558: Use correct backlink for managing officer corporate
  • Loading branch information
mwejuli-ch committed Jul 8, 2024
2 parents 594ba28 + b505cb3 commit 222e5eb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/controllers/managing.officer.corporate.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ import { isActiveFeature } from "../utils/feature.flag";
import { getUrlWithParamsToPath } from "../utils/url";

export const get = (req: Request, res: Response) => {
let backLinkUrl: string = config.MANAGING_OFFICER_CORPORATE_PAGE;
if (isActiveFeature(config.FEATURE_FLAG_ENABLE_REDIS_REMOVAL)) {
backLinkUrl = getUrlWithParamsToPath(config.MANAGING_OFFICER_CORPORATE_WITH_PARAMS_URL, req);
}
const backLinkUrl = isActiveFeature(config.FEATURE_FLAG_ENABLE_REDIS_REMOVAL)
? getUrlWithParamsToPath(config.BENEFICIAL_OWNER_TYPE_WITH_PARAMS_URL, req)
: config.BENEFICIAL_OWNER_TYPE_URL;
getManagingOfficerCorporate(req, res, backLinkUrl, config.MANAGING_OFFICER_CORPORATE_PAGE);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ describe("MANAGING_OFFICER CORPORATE controller", () => {
expect(resp.text).toContain(SAVE_AND_CONTINUE_BUTTON_TEXT);
expect(resp.text).toContain(INFORMATION_SHOWN_ON_THE_PUBLIC_REGISTER);
expect(resp.text).toContain(SHOW_INFORMATION_ON_PUBLIC_REGISTER);
expect(resp.text).toContain(NEXT_PAGE_URL);
expect(resp.text).toContain(BACK_BUTTON_CLASS);
expect(mockIsActiveFeature).toHaveBeenCalledTimes(1);
});

Expand Down

0 comments on commit 222e5eb

Please sign in to comment.