Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -97,25 +97,25 @@ describe('DotNetFrameworkStep', () => {
expect(screen.getByRole('combobox')).toBeInTheDocument();
});

it('should render .NET 8 and .NET 10 options on non-Windows', () => {
it('should render only .NET 10 on non-Windows', () => {
renderWithStore({ logicAppType: ProjectType.customCode, platform: null });
const combobox = screen.getByRole('combobox');
fireEvent.click(combobox);
expect(screen.getByText('.NET 8')).toBeInTheDocument();
expect(screen.getByText('.NET 10')).toBeInTheDocument();
expect(screen.queryByText('.NET 8')).not.toBeInTheDocument();
});

it('should also render .NET Framework option on Windows', () => {
renderWithStore({ logicAppType: ProjectType.customCode, platform: 'win32' as any });
const combobox = screen.getByRole('combobox');
fireEvent.click(combobox);
// Positive Windows case: the dropdown must expose exactly the three correct options.
// Positive Windows case: the dropdown must expose exactly the two supported options.
expect(screen.getByText('.NET Framework')).toBeInTheDocument();
expect(screen.getByText('.NET 8')).toBeInTheDocument();
expect(screen.getByText('.NET 10')).toBeInTheDocument();
expect(screen.queryByText('.NET 8')).not.toBeInTheDocument();
const options = screen.getAllByRole('option');
expect(options).toHaveLength(3);
expect(options.map((option) => option.textContent)).toEqual(['.NET Framework', '.NET 8', '.NET 10']);
expect(options).toHaveLength(2);
expect(options.map((option) => option.textContent)).toEqual(['.NET Framework', '.NET 10']);
});

it('should not render .NET Framework option on non-Windows', () => {
Expand All @@ -130,21 +130,21 @@ describe('DotNetFrameworkStep', () => {
const combobox = screen.getByRole('combobox');
fireEvent.click(combobox);
expect(screen.queryByText('.NET Framework')).not.toBeInTheDocument();
expect(screen.getByText('.NET 8')).toBeInTheDocument();
expect(screen.getByText('.NET 10')).toBeInTheDocument();
expect(screen.queryByText('.NET 8')).not.toBeInTheDocument();
const options = screen.getAllByRole('option');
expect(options.map((option) => option.textContent)).toEqual(['.NET 8', '.NET 10']);
expect(options.map((option) => option.textContent)).toEqual(['.NET 10']);
});

it('should not render .NET Framework option when platform is not yet initialized (null)', () => {
renderWithStore({ logicAppType: ProjectType.customCode, platform: null });
const combobox = screen.getByRole('combobox');
fireEvent.click(combobox);
expect(screen.queryByText('.NET Framework')).not.toBeInTheDocument();
expect(screen.getByText('.NET 8')).toBeInTheDocument();
expect(screen.getByText('.NET 10')).toBeInTheDocument();
expect(screen.queryByText('.NET 8')).not.toBeInTheDocument();
const options = screen.getAllByRole('option');
expect(options.map((option) => option.textContent)).toEqual(['.NET 8', '.NET 10']);
expect(options.map((option) => option.textContent)).toEqual(['.NET 10']);
});
});

Expand All @@ -158,15 +158,6 @@ describe('DotNetFrameworkStep', () => {
expect(combobox).toHaveTextContent('.NET 10');
});

it('should show .NET 8 label when net8 is selected', () => {
renderWithStore({
logicAppType: ProjectType.customCode,
targetFramework: 'net8',
});
const combobox = screen.getByRole('combobox');
expect(combobox).toHaveTextContent('.NET 8');
});

it('should show description text when a framework is selected', () => {
renderWithStore({
logicAppType: ProjectType.customCode,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,6 @@ export const DotNetFrameworkStep: React.FC = () => {
},
]
: []),
{
value: TargetFramework.Net8,
label: intlText.DOTNET_8,
description: intlText.DOTNET_8_DESCRIPTION,
},
{
value: TargetFramework.Net10,
label: intlText.DOTNET_10,
Expand Down
Loading