From a307b0f84c2747049d31cc6f7886d98f9d576470 Mon Sep 17 00:00:00 2001 From: ghalestrilo Date: Thu, 30 Apr 2020 12:47:12 -0300 Subject: [PATCH] :white_check_mark: add tests for current filename validation --- client/components/__test__/FileNode.test.jsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/client/components/__test__/FileNode.test.jsx b/client/components/__test__/FileNode.test.jsx index 81fcb452..756652a3 100644 --- a/client/components/__test__/FileNode.test.jsx +++ b/client/components/__test__/FileNode.test.jsx @@ -82,8 +82,6 @@ describe('', () => { beforeEach(() => changeName(newName)); it('should save the name', () => { - console.log('component.state'); - console.log(component.state()); expect(props.updateFileName).toBeCalledWith(props.id, newName); }); }); @@ -158,6 +156,14 @@ describe('', () => { 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', () => { const newName = 'filename.jsx'; beforeEach(() => changeName(newName));