-
Notifications
You must be signed in to change notification settings - Fork 753
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4773 from berkarslan-xo/bugfix/Issue-4772
Issue-4772 - Wrong PortalId is getting set when there are multiple sites existing
- Loading branch information
Showing
3 changed files
with
37 additions
and
2 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
29 changes: 29 additions & 0 deletions
29
...dminExperience/ClientSide/SiteSettings.Web/src/reducers/__tests__/siteInfoReducer.test.js
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import siteInfo from "../siteInfoReducer"; | ||
import { siteInfo as ActionTypes } from "../../constants/actionTypes"; | ||
|
||
describe("Site Info Reducer", () => { | ||
it("Sets the current portal id correctly when there are multiple sites", () => { | ||
// Arrange | ||
let action = { | ||
type: ActionTypes.RETRIEVED_PORTALS, | ||
data: { | ||
portals: [ | ||
{ | ||
PortalID: 0, | ||
IsCurrentPortal: false | ||
}, | ||
{ | ||
PortalID: 1, | ||
IsCurrentPortal: true | ||
} | ||
] | ||
} | ||
}; | ||
|
||
// Act | ||
let state = siteInfo({}, action); | ||
|
||
// Assert | ||
expect(state.portalId).toEqual(1); | ||
}); | ||
}); |
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