-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat : 라우터 페이지 렌더링 부분 수정 및 실제 페이지 컴포넌트 import 테스트 코드 작성
- Loading branch information
Showing
4 changed files
with
82 additions
and
2 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,3 +1,6 @@ | ||
module.exports = { | ||
testEnvironment: 'jsdom', | ||
moduleNameMapper: { | ||
'^@/(.*)$': '<rootDir>/src/$1', | ||
}, | ||
}; |
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,35 @@ | ||
import Component from '@/core/Component'; | ||
import Header from '@/components/Header'; | ||
import Footer from '@/components/Footer'; | ||
import Banner from '@/components/Banner'; | ||
|
||
class Page extends Component { | ||
constructor(target, props, routePage) { | ||
super(target, props); | ||
|
||
this.renderLayout(routePage); | ||
} | ||
|
||
template() { | ||
return ` | ||
<header></header> | ||
<div class="content"></div> | ||
<div class="banner"></div> | ||
<footer></footer> | ||
`; | ||
} | ||
|
||
renderLayout(routePage) { | ||
const header = this.target.querySelector('header'); | ||
const content = this.target.querySelector('.content'); | ||
const banner = this.target.querySelector('.banner'); | ||
const footer = this.target.querySelector('footer'); | ||
|
||
new Header(header, {}); | ||
new routePage(content, this.props); | ||
new Banner(banner, {}); | ||
new Footer(footer, {}); | ||
} | ||
} | ||
|
||
export default Page; |
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