generated from Real-Dev-Squad/website-template
-
Notifications
You must be signed in to change notification settings - Fork 3
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 #120 from Real-Dev-Squad/develop
dev to main merge
- Loading branch information
Showing
18 changed files
with
305 additions
and
134 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 |
---|---|---|
@@ -1,5 +1,11 @@ | ||
import { getAllUrlHandler, getOriginalUrlHandler, shortenUrlHandler } from './handlers/url'; | ||
import { deleteUrlHandler, getAllUrlHandler, getOriginalUrlHandler, shortenUrlHandler } from './handlers/url'; | ||
import { getSelfUserHandler } from './handlers/user'; | ||
|
||
const handlers = [...getSelfUserHandler, ...getAllUrlHandler, ...getOriginalUrlHandler, ...shortenUrlHandler]; | ||
const handlers = [ | ||
...deleteUrlHandler, | ||
...getSelfUserHandler, | ||
...getAllUrlHandler, | ||
...getOriginalUrlHandler, | ||
...shortenUrlHandler, | ||
]; | ||
export default handlers; |
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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { render, screen } from '@testing-library/react'; | ||
|
||
import { DashboardLayout } from '@/components/Dashboard/dashboard-layout'; | ||
|
||
describe('DashboardLayout', () => { | ||
test('renders DashboardLayout with children', () => { | ||
render( | ||
<DashboardLayout remainingUrls={10}> | ||
<div>Test Child Component</div> | ||
</DashboardLayout> | ||
); | ||
expect(screen.getByText('Your URLs')).toBeInTheDocument(); | ||
expect(screen.getByText('Remaining: 10 / 50')).toBeInTheDocument(); | ||
expect(screen.getByText('Test Child Component')).toBeInTheDocument(); | ||
}); | ||
|
||
test('renders DashboardLayout without remainingUrls', () => { | ||
render( | ||
<DashboardLayout> | ||
<div>Test Child Component</div> | ||
</DashboardLayout> | ||
); | ||
expect(screen.getByText('Your URLs')).toBeInTheDocument(); | ||
expect(screen.queryByText(/Remaining:/)).toBeNull(); | ||
expect(screen.getByText('Test Child Component')).toBeInTheDocument(); | ||
}); | ||
|
||
test('renders DashboardLayout with maximum URLs', () => { | ||
render( | ||
<DashboardLayout remainingUrls={50}> | ||
<div>Test Child Component</div> | ||
</DashboardLayout> | ||
); | ||
expect(screen.getByText('Your URLs')).toBeInTheDocument(); | ||
expect(screen.getByText('Remaining: 50 / 50')).toBeInTheDocument(); | ||
expect(screen.getByText('Test Child Component')).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 was deleted.
Oops, something went wrong.
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
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 was deleted.
Oops, something went wrong.
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.