@@ -25,7 +25,7 @@ describe("account not found controller", () => {
2525 } ) ;
2626
2727 describe ( "accountNotFoundGet" , ( ) => {
28- describe ( "when strategicAppChannel is not defined" , ( ) => {
28+ describe ( "when strategicAppChannel or mobileChannel is not defined" , ( ) => {
2929 it ( "should render the account not found mandatory view when serviceType undefined" , ( ) => {
3030 accountNotFoundGet ( req , res ) ;
3131
@@ -53,9 +53,10 @@ describe("account not found controller", () => {
5353 } ) ;
5454 } ) ;
5555
56- describe ( "when strategicAppChannel is false" , ( ) => {
56+ describe ( "when strategicAppChannel and mobileChannel are false" , ( ) => {
5757 beforeEach ( ( ) => {
5858 res . locals . strategicAppChannel = false ;
59+ res . locals . mobileChannel = false ;
5960 } ) ;
6061
6162 it ( "should render the account not found mandatory view when serviceType undefined" , ( ) => {
@@ -85,35 +86,47 @@ describe("account not found controller", () => {
8586 } ) ;
8687 } ) ;
8788
88- describe ( "when strategicAppChannel is true" , ( ) => {
89- beforeEach ( ( ) => {
90- res . locals . strategicAppChannel = true ;
91- } ) ;
89+ describe ( "when strategicAppChannel or mobileChannel are true" , ( ) => {
90+ const testCases = [
91+ { strategicAppChannel : true , mobileChannel : false } ,
92+ { strategicAppChannel : false , mobileChannel : true } ,
93+ ] ;
9294
93- it ( "should render the account not found mandatory view when serviceType undefined" , ( ) => {
94- accountNotFoundGet ( req , res ) ;
95+ testCases . forEach ( ( testCase ) => {
96+ it ( "should render the account not found mandatory view when serviceType undefined" , ( ) => {
97+ res . locals . strategicAppChannel = testCase . strategicAppChannel ;
98+ res . locals . mobileChannel = testCase . mobileChannel ;
9599
96- expect ( res . render ) . to . have . calledWith (
97- "account-not-found/index-mobile.njk"
98- ) ;
99- } ) ;
100+ accountNotFoundGet ( req , res ) ;
100101
101- it ( "should render the account not found optional view when serviceType optional" , ( ) => {
102- req . session . client . serviceType = SERVICE_TYPE . OPTIONAL ;
103- accountNotFoundGet ( req , res ) ;
102+ expect ( res . render ) . to . have . calledWith (
103+ "account-not-found/index-mobile.njk"
104+ ) ;
105+ } ) ;
104106
105- expect ( res . render ) . to . have . calledWith (
106- "account-not-found/index-mobile.njk"
107- ) ;
108- } ) ;
107+ it ( "should render the account not found optional view when serviceType optional" , ( ) => {
108+ req . session . client . serviceType = SERVICE_TYPE . OPTIONAL ;
109+ res . locals . strategicAppChannel = testCase . strategicAppChannel ;
110+ res . locals . mobileChannel = testCase . mobileChannel ;
109111
110- it ( "should render the account not found optional view when the service is part of One Login" , ( ) => {
111- req . session . client . isOneLoginService = true ;
112- accountNotFoundGet ( req , res ) ;
112+ accountNotFoundGet ( req , res ) ;
113113
114- expect ( res . render ) . to . have . calledWith (
115- "account-not-found/index-mobile.njk"
116- ) ;
114+ expect ( res . render ) . to . have . calledWith (
115+ "account-not-found/index-mobile.njk"
116+ ) ;
117+ } ) ;
118+
119+ it ( "should render the account not found optional view when the service is part of One Login" , ( ) => {
120+ req . session . client . isOneLoginService = true ;
121+ res . locals . strategicAppChannel = testCase . strategicAppChannel ;
122+ res . locals . mobileChannel = testCase . mobileChannel ;
123+
124+ accountNotFoundGet ( req , res ) ;
125+
126+ expect ( res . render ) . to . have . calledWith (
127+ "account-not-found/index-mobile.njk"
128+ ) ;
129+ } ) ;
117130 } ) ;
118131 } ) ;
119132 } ) ;
0 commit comments