Handle kick, rename server to network
This commit is contained in:
parent
a33157ff84
commit
6985dd16da
65 changed files with 2650 additions and 2179 deletions
20
client/js/state/__tests__/actions-networks.test.js
Normal file
20
client/js/state/__tests__/actions-networks.test.js
Normal file
|
@ -0,0 +1,20 @@
|
|||
import { connect, setNetworkName } from '../networks';
|
||||
|
||||
describe('setNetworkName()', () => {
|
||||
it('passes valid names to the network', () => {
|
||||
const name = 'cake';
|
||||
const network = 'srv';
|
||||
|
||||
expect(setNetworkName(name, network)).toMatchObject({
|
||||
socket: {
|
||||
type: 'set_network_name',
|
||||
data: { name, network }
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
it('does not pass invalid names to the network', () => {
|
||||
expect(setNetworkName('', 'srv').socket).toBeUndefined();
|
||||
expect(setNetworkName(' ', 'srv').socket).toBeUndefined();
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue