add tests for current filename validation

This commit is contained in:
ghalestrilo 2020-04-30 12:47:12 -03:00
parent 3b2d5ba903
commit a307b0f84c

View file

@ -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));