✅ add tests for current filename validation
This commit is contained in:
parent
3b2d5ba903
commit
a307b0f84c
1 changed files with 8 additions and 2 deletions
|
@ -82,8 +82,6 @@ describe('<FileNode />', () => {
|
||||||
beforeEach(() => changeName(newName));
|
beforeEach(() => changeName(newName));
|
||||||
|
|
||||||
it('should save the name', () => {
|
it('should save the name', () => {
|
||||||
console.log('component.state');
|
|
||||||
console.log(component.state());
|
|
||||||
expect(props.updateFileName).toBeCalledWith(props.id, newName);
|
expect(props.updateFileName).toBeCalledWith(props.id, newName);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -158,6 +156,14 @@ describe('<FileNode />', () => {
|
||||||
component.setState({ isEditing: true });
|
component.setState({ isEditing: true });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('to a foldername', () => {
|
||||||
|
const newName = 'newfoldername';
|
||||||
|
beforeEach(() => changeName(newName));
|
||||||
|
|
||||||
|
it('should save', () => expect(props.updateFileName).toBeCalledWith(props.id, newName));
|
||||||
|
it('should update name', () => expect(getUpdatedName()).toEqual(newName));
|
||||||
|
});
|
||||||
|
|
||||||
describe('to a filename', () => {
|
describe('to a filename', () => {
|
||||||
const newName = 'filename.jsx';
|
const newName = 'filename.jsx';
|
||||||
beforeEach(() => changeName(newName));
|
beforeEach(() => changeName(newName));
|
||||||
|
|
Loading…
Reference in a new issue