1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-08-05 05:45:22 +02:00

refactor(docker networks): migrate docker network detail view to react EE-2196 (#6700)

* Migrate network details to react
This commit is contained in:
Ali 2022-05-10 09:01:15 +12:00 committed by GitHub
parent 9650aa56c7
commit 2e0555dbca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 981 additions and 261 deletions

View file

@ -0,0 +1,34 @@
import { render } from '@/react-tools/test-utils';
import { NetworkOptions } from '../types';
import { NetworkOptionsTable } from './NetworkOptionsTable';
const options: NetworkOptions = {
'com.docker.network.bridge.default_bridge': 'true',
'com.docker.network.bridge.enable_icc': 'true',
'com.docker.network.bridge.enable_ip_masquerade': 'true',
'com.docker.network.bridge.host_binding_ipv4': '0.0.0.0',
'com.docker.network.bridge.name': 'docker0',
'com.docker.network.driver.mtu': '1500',
};
test('Network options values should be visible', async () => {
const { findByText, findAllByText } = render(
<NetworkOptionsTable options={options} />
);
await expect(findByText('Network options')).resolves.toBeVisible();
// expect to find three 'true' values for the first 3 options
const cells = await findAllByText('true');
expect(cells).toHaveLength(3);
await expect(
findByText(options['com.docker.network.bridge.host_binding_ipv4'])
).resolves.toBeVisible();
await expect(
findByText(options['com.docker.network.bridge.name'])
).resolves.toBeVisible();
await expect(
findByText(options['com.docker.network.driver.mtu'])
).resolves.toBeVisible();
});