@@ -2,7 +2,7 @@ import { Provider } from "react-redux";
22import { MemoryRouter } from "react-router-dom" ;
33import configureStore from "redux-mock-store" ;
44
5- import DownloadImages from "@/app/images/components/ImagesTable/DownloadImages/DownloadImages " ;
5+ import SelectUpstreamImagesForm from "@/app/images/components/ImagesForms/SelectUpstreamImagesForm/SelectUpstreamImagesForm " ;
66import { bootResourceActions } from "@/app/store/bootresource" ;
77import { BootResourceSourceType } from "@/app/store/bootresource/types" ;
88import type { RootState } from "@/app/store/root/types" ;
@@ -17,8 +17,8 @@ import {
1717
1818const mockStore = configureStore < RootState , { } > ( ) ;
1919
20- describe ( "DownloadImages " , ( ) => {
21- it ( "correctly sets initial values" , ( ) => {
20+ describe ( "SelectUpstreamImagesForm " , ( ) => {
21+ it ( "correctly sets initial values" , async ( ) => {
2222 const ubuntu = factory . bootResourceUbuntu ( {
2323 arches : [
2424 {
@@ -75,10 +75,13 @@ describe("DownloadImages", () => {
7575 } ) ,
7676 } ) ;
7777
78- renderWithBrowserRouter ( < DownloadImages /> , {
78+ renderWithBrowserRouter ( < SelectUpstreamImagesForm /> , {
7979 state,
8080 } ) ;
8181
82+ await userEvent . click ( screen . getByText ( "Ubuntu" ) ) ;
83+ await userEvent . click ( screen . getByText ( "Centos" ) ) ;
84+
8285 const rowUbuntu = within (
8386 screen . getByRole ( "row" , { name : "16.04 LTS" } )
8487 ) . getAllByRole ( "combobox" ) ;
@@ -154,12 +157,14 @@ describe("DownloadImages", () => {
154157 render (
155158 < Provider store = { store } >
156159 < MemoryRouter >
157- < DownloadImages />
160+ < SelectUpstreamImagesForm />
158161 </ MemoryRouter >
159162 </ Provider >
160163 ) ;
161164
162- await userEvent . click ( screen . getByRole ( "button" , { name : "Download" } ) ) ;
165+ await userEvent . click (
166+ screen . getByRole ( "button" , { name : "Save and sync" } )
167+ ) ;
163168
164169 const expectedUbuntuAction = bootResourceActions . saveUbuntu ( {
165170 osystems : [
@@ -201,7 +206,7 @@ describe("DownloadImages", () => {
201206 } ,
202207 } ) ,
203208 } ) ;
204- renderWithBrowserRouter ( < DownloadImages /> , {
209+ renderWithBrowserRouter ( < SelectUpstreamImagesForm /> , {
205210 state,
206211 } ) ;
207212
0 commit comments