-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from oslabs-beta/master-holder
Finalise alpha release
- Loading branch information
Showing
37 changed files
with
7,054 additions
and
14,360 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,19 @@ | ||
import React from 'react'; | ||
import { render, screen, fireEvent } from '../src/test-utils.js'; | ||
import '@testing-library/jest-dom/extend-expect'; | ||
// import DnD from '../src/components/DnD'; | ||
import CompCreator from '../src/components/CompCreator'; | ||
import Tree from '../src/components/Tree'; | ||
// import TreeRecursive from '../src/components/TreeRecursive'; | ||
import TreeFile from '../src/components/TreeFile'; | ||
|
||
describe('Left Panel', () => { | ||
test('renders CompCreator component with input field and add button', () => { | ||
const { getByTestId } = render(<CompCreator />); | ||
expect(screen.getByText('React Component')).toBeInTheDocument(); | ||
expect(screen.getByRole('textbox')).toBeInTheDocument(); | ||
const addButton = getByTestId('add-button'); | ||
expect(addButton).toBeInTheDocument(); | ||
// const mockFunction = jest.fn(() => true); | ||
// fireEvent.click(addButton); | ||
// expect(mockFunction()).toBe(true); | ||
}); | ||
|
||
test('value of comp creator input field changes', () => { | ||
const { queryByPlaceholderText } = render(<CompCreator />); | ||
const input = queryByPlaceholderText('Component Name'); | ||
fireEvent.change(input, { target: { value: 'test' } }); | ||
expect(input.value).toBe('test'); | ||
expect(input.value).toBe('test'); | ||
}); | ||
|
||
test('renders the tree component which displays file tree', () => { | ||
const { getByTestId } = render(<Tree />); | ||
expect(getByTestId('filetree')).toBeInTheDocument(); | ||
}); | ||
|
||
// test('renders the tree folders with on click functionality', () => { | ||
// const { getByTestId } = render(<TreeRecursive />); | ||
// expect(getByTestId('folder')).toBeInTheDocument(); | ||
// }); | ||
|
||
// test('renders the tree files with on click functionality', () => { | ||
// const { getByTestId } = render(<TreeFile />); | ||
// expect(getByTestId('file')).toBeInTheDocument(); | ||
// }); | ||
|
||
//HAVING ISSUES WITH TESTS INVOLVING DND DUE TO PROVIDER/STORE ISSUE WITH REACT TESTING LIBRARY | ||
|
||
// test('renders fflow logo with on click functionality', () => { | ||
// const { getByTestId } = render(<DnD />); | ||
// const appLogo = getByTestId('app-logo'); | ||
// expect(appLogo).toBeInTheDocument(); | ||
// const mockFunction = jest.fn(() => true); | ||
// fireEvent.click(appLogo); | ||
// expect(mockFunction()).toBe(true); | ||
// }); | ||
|
||
// test('renders tree component', () => { | ||
// render(<DnD />); | ||
// expect(screen.getByText('FOLDERS')).toBeInTheDocument(); | ||
// }); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.