-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7f75bb0
commit 015f3e1
Showing
5 changed files
with
2,011 additions
and
69 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -525,4 +525,5 @@ export default function DragAndDropGrid() { | |
</DragDropContext> | ||
</div> | ||
); | ||
} | ||
} | ||
|
30 changes: 30 additions & 0 deletions
30
frontend-interface/components/__tests__/DragAndDropGrid.test.js
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import React from 'react'; | ||
import { render, screen } from '@testing-library/react'; | ||
import React from 'react'; | ||
import { render, screen } from '@testing-library/react'; | ||
import DragAndDropGrid from '../DragAndDropGrid'; | ||
|
||
test('renders drag and drop grid', () => { | ||
render(<DragAndDropGrid />); | ||
const dragAndDropGridElement = screen.getByText(/drag and drop grid/i); | ||
expect(dragAndDropGridElement).toBeInTheDocument(); | ||
}); | ||
|
||
test('renders grid items', () => { | ||
render(<DragAndDropGrid />); | ||
const gridItemElements = screen.getAllByTestId('grid-item'); | ||
expect(gridItemElements.length).toBeGreaterThan(0); | ||
}); | ||
|
||
test('allows dragging of grid items', () => { | ||
render(<DragAndDropGrid />); | ||
const gridItemElement = screen.getByTestId('grid-item-1'); | ||
expect(gridItemElement).toHaveAttribute('draggable', 'true'); | ||
}); | ||
|
||
test('allows dropping of grid items', () => { | ||
render(<DragAndDropGrid />); | ||
const dropZoneElement = screen.getByTestId('drop-zone'); | ||
expect(dropZoneElement).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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module.exports = { | ||
testEnvironment: 'jsdom', | ||
testMatch: ['**/__tests__/**/*.js?(x)', '**/?(*.)+(spec|test).js?(x)'], | ||
}; |
Oops, something went wrong.