@@ -903,6 +903,150 @@ describe('Create Linode with Firewall (Linode Interfaces)', () => {
903903 ui . toast . assertMessage ( `Your Linode ${ mockLinode . label } is being created.` ) ;
904904 } ) ;
905905
906+ /*
907+ * Legacy Configuration Profile Interfaces
908+ * - Confirms UI flow to create a Linode with "No firewall" option.
909+ * - Confirms that no firewall is reflected in create summary section.
910+ * - Confirms that outgoing Linode Create API request specifies no Firewall to be attached.
911+ */
912+ it ( 'can assign "No firewall" option during Linode Create flow (legacy)' , ( ) => {
913+ const mockLinode = linodeFactory . build ( {
914+ id : randomNumber ( ) ,
915+ label : randomLabel ( ) ,
916+ region : linodeRegion . id ,
917+ } ) ;
918+
919+ mockCreateLinode ( mockLinode ) . as ( 'createLinode' ) ;
920+ mockGetLinodeDetails ( mockLinode . id , mockLinode ) ;
921+
922+ cy . visitWithLogin ( '/linodes/create' ) ;
923+
924+ linodeCreatePage . setLabel ( mockLinode . label ) ;
925+ linodeCreatePage . selectImage ( 'Debian 12' ) ;
926+ linodeCreatePage . selectRegionById ( linodeRegion . id ) ;
927+ linodeCreatePage . selectPlan ( 'Shared CPU' , 'Nanode 1 GB' ) ;
928+ linodeCreatePage . setRootPassword ( randomString ( 32 ) ) ;
929+
930+ // Confirm the Linode Interfaces section is shown.
931+ assertNewLinodeInterfacesIsAvailable ( ) ;
932+
933+ // Switch to legacy Config Interfaces
934+ linodeCreatePage . selectLegacyConfigInterfacesType ( ) ;
935+
936+ // Select a firewall
937+ linodeCreatePage . selectFirewall (
938+ 'No firewall - traffic is unprotected (not recommended)' ,
939+ 'Firewall'
940+ ) ;
941+
942+ // Create Linode and confirm contents of outgoing API request payload.
943+ ui . button
944+ . findByTitle ( 'Create Linode' )
945+ . should ( 'be.visible' )
946+ . should ( 'be.enabled' )
947+ . click ( ) ;
948+
949+ cy . wait ( '@createLinode' ) . then ( ( xhr ) => {
950+ const requestPayload = xhr . request . body ;
951+ const firewallId = requestPayload [ 'firewall_id' ] ;
952+ expect ( firewallId ) . to . equal ( - 1 ) ;
953+ } ) ;
954+
955+ // Confirm redirect to new Linode.
956+ cy . url ( ) . should ( 'endWith' , `/linodes/${ mockLinode . id } ` ) ;
957+ // Confirm toast notification should appear on Linode create.
958+ ui . toast . assertMessage ( `Your Linode ${ mockLinode . label } is being created.` ) ;
959+ } ) ;
960+
961+ /*
962+ * Linode Interfaces
963+ * - Confirms UI flow to create a Linode with "No firewall" option.
964+ * - Confirms that no firewall is reflected in create summary section.
965+ * - Confirms that outgoing Linode Create API request specifies no Firewall to be attached.
966+ */
967+ it ( 'can assign "No firewall" option during Linode Create flow (Linode Interfaces)' , ( ) => {
968+ const mockLinode = linodeFactory . build ( {
969+ id : randomNumber ( ) ,
970+ label : randomLabel ( ) ,
971+ region : linodeRegion . id ,
972+ } ) ;
973+
974+ mockCreateLinode ( mockLinode ) . as ( 'createLinode' ) ;
975+ mockGetLinodeDetails ( mockLinode . id , mockLinode ) ;
976+
977+ cy . visitWithLogin ( '/linodes/create' ) ;
978+
979+ linodeCreatePage . setLabel ( mockLinode . label ) ;
980+ linodeCreatePage . selectImage ( 'Debian 12' ) ;
981+ linodeCreatePage . selectRegionById ( linodeRegion . id ) ;
982+ linodeCreatePage . selectPlan ( 'Shared CPU' , 'Nanode 1 GB' ) ;
983+ linodeCreatePage . setRootPassword ( randomString ( 32 ) ) ;
984+
985+ // Confirm the Linode Interfaces section is shown.
986+ assertNewLinodeInterfacesIsAvailable ( ) ;
987+
988+ linodeCreatePage . selectFirewall (
989+ 'No firewall - traffic is unprotected (not recommended)' ,
990+ 'Public Interface Firewall'
991+ ) ;
992+
993+ // Create Linode and confirm contents of outgoing API request payload.
994+ ui . button
995+ . findByTitle ( 'Create Linode' )
996+ . should ( 'be.visible' )
997+ . should ( 'be.enabled' )
998+ . click ( ) ;
999+
1000+ cy . wait ( '@createLinode' ) . then ( ( xhr ) => {
1001+ const requestPayload = xhr . request . body ;
1002+ const firewallId = requestPayload [ 'interfaces' ] [ 0 ] [ 'firewall_id' ] ;
1003+ expect ( firewallId ) . to . equal ( - 1 ) ;
1004+ } ) ;
1005+
1006+ // Confirm redirect to new Linode.
1007+ cy . url ( ) . should ( 'endWith' , `/linodes/${ mockLinode . id } ` ) ;
1008+ // Confirm toast notification should appear on Linode create.
1009+ ui . toast . assertMessage ( `Your Linode ${ mockLinode . label } is being created.` ) ;
1010+ } ) ;
1011+
1012+ /*
1013+ * Mocks no selection made in firewall dropdown.
1014+ * Confirms that correct validation error message is shown on the page when attempting to create a Linode.
1015+ */
1016+ it ( 'displays validation error related to firewall if no selection made in firewall dropdown' , ( ) => {
1017+ const mockLinode = linodeFactory . build ( {
1018+ id : randomNumber ( ) ,
1019+ label : randomLabel ( ) ,
1020+ region : linodeRegion . id ,
1021+ } ) ;
1022+
1023+ mockCreateLinode ( mockLinode ) . as ( 'createLinode' ) ;
1024+ mockGetLinodeDetails ( mockLinode . id , mockLinode ) ;
1025+
1026+ cy . visitWithLogin ( '/linodes/create' ) ;
1027+
1028+ linodeCreatePage . setLabel ( mockLinode . label ) ;
1029+ linodeCreatePage . selectImage ( 'Debian 12' ) ;
1030+ linodeCreatePage . selectRegionById ( linodeRegion . id ) ;
1031+ linodeCreatePage . selectPlan ( 'Shared CPU' , 'Nanode 1 GB' ) ;
1032+ linodeCreatePage . setRootPassword ( randomString ( 32 ) ) ;
1033+
1034+ // Confirm the Linode Interfaces section is shown.
1035+ assertNewLinodeInterfacesIsAvailable ( ) ;
1036+
1037+ // Create Linode and confirm contents of outgoing API request payload.
1038+ ui . button
1039+ . findByTitle ( 'Create Linode' )
1040+ . should ( 'be.visible' )
1041+ . should ( 'be.enabled' )
1042+ . click ( ) ;
1043+
1044+ // Confirm the correct validation error related to firewall show up on the page.
1045+ cy . findByText ( 'Select an option or create a new Firewall.' ) . should (
1046+ 'be.visible'
1047+ ) ;
1048+ } ) ;
1049+
9061050 /*
9071051 * - Mocks the internal header to enable the Generate Compliant Firewall banner.
9081052 * - Mocks an error response to the Create Firewall call.
0 commit comments