mirror of
https://github.com/Dispatcharr/Dispatcharr.git
synced 2026-07-18 00:55:50 +00:00
test: update validation for empty CIDR range to allow defaults on submit
Some checks failed
CI Pipeline / prepare (push) Has been cancelled
Build and Push Multi-Arch Docker Image / build-and-push (push) Has been cancelled
Frontend Tests / test (push) Has been cancelled
CI Pipeline / docker (amd64, ubuntu-24.04) (push) Has been cancelled
CI Pipeline / docker (arm64, ubuntu-24.04-arm) (push) Has been cancelled
CI Pipeline / create-manifest (push) Has been cancelled
Some checks failed
CI Pipeline / prepare (push) Has been cancelled
Build and Push Multi-Arch Docker Image / build-and-push (push) Has been cancelled
Frontend Tests / test (push) Has been cancelled
CI Pipeline / docker (amd64, ubuntu-24.04) (push) Has been cancelled
CI Pipeline / docker (arm64, ubuntu-24.04-arm) (push) Has been cancelled
CI Pipeline / create-manifest (push) Has been cancelled
This commit is contained in:
parent
7cd4abb694
commit
61d713fcda
2 changed files with 10 additions and 8 deletions
|
|
@ -313,10 +313,10 @@ describe('NetworkAccessForm', () => {
|
|||
fireEvent.click(screen.getByTestId('confirm-ok'));
|
||||
|
||||
await waitFor(() => {
|
||||
expect(screen.getByTestId('alert')).toBeInTheDocument();
|
||||
expect(screen.getByTestId('alert-title')).toHaveTextContent(
|
||||
'Saved Successfully'
|
||||
);
|
||||
const alertTitles = screen.getAllByTestId('alert-title');
|
||||
expect(
|
||||
alertTitles.some((el) => el.textContent === 'Saved Successfully')
|
||||
).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
@ -399,9 +399,10 @@ describe('NetworkAccessForm', () => {
|
|||
fireEvent.click(screen.getByTestId('confirm-ok'));
|
||||
|
||||
await waitFor(() => {
|
||||
expect(screen.getByTestId('alert-title')).toHaveTextContent(
|
||||
'Saved Successfully'
|
||||
);
|
||||
const alertTitles = screen.getAllByTestId('alert-title');
|
||||
expect(
|
||||
alertTitles.some((el) => el.textContent === 'Saved Successfully')
|
||||
).toBe(true);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -131,7 +131,8 @@ describe('NetworkAccessFormUtils', () => {
|
|||
NetworkAccessFormUtils.getNetworkAccessFormValidation();
|
||||
const validator = validation['network-access-admin'];
|
||||
|
||||
expect(validator('')).toBe('Invalid CIDR range');
|
||||
// Empty values are allowed — defaults are substituted on submit
|
||||
expect(validator('')).toBe(null);
|
||||
});
|
||||
|
||||
it('should return empty object when NETWORK_ACCESS_OPTIONS is empty', () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue