-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(nextjs): generate working spec file for --appDir
- Loading branch information
1 parent
786323d
commit 17147a1
Showing
4 changed files
with
31 additions
and
15 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
8 changes: 4 additions & 4 deletions
8
packages/next/src/generators/application/files/common/specs/__fileName__.spec.tsx__tmpl__
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,11 +1,11 @@ | ||
import React from 'react'; | ||
import { render } from '@testing-library/react'; | ||
<% if(appDir) {%> import Page from '../apps/page';<% } else {%>import Index from '../pages/index';<% } %> | ||
|
||
import Index from '../pages/index'; | ||
|
||
describe('Index', () => { | ||
describe('<% if(appDir) { %>Page<% } else { %>Index<% } %>', () => { | ||
it('should render successfully', () => { | ||
const { baseElement } = render(<Index />); | ||
const { baseElement } = render(<% if(appDir) { %><Page /><% } else { %><Index /><% } %>); | ||
|
||
expect(baseElement).toBeTruthy(); | ||
}); | ||
}); |
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