Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
pro-layout
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
packages
pro-layout
Commits
30e7632c
Commit
30e7632c
authored
Dec 09, 2020
by
Sendya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: add global-footer test
parent
c3b27a24
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
93 additions
and
6 deletions
+93
-6
package.json
package.json
+5
-1
SiderMenu.tsx
src/SiderMenu/SiderMenu.tsx
+1
-1
global-footer.test.tsx.snap
tests/__snapshots__/global-footer.test.tsx.snap
+8
-0
global-footer.test.tsx
tests/global-footer.test.tsx
+70
-0
index.test.tsx
tests/index.test.tsx
+9
-4
No files found.
package.json
View file @
30e7632c
...
@@ -28,6 +28,9 @@
...
@@ -28,6 +28,9 @@
},
},
"devDependencies"
:
{
"devDependencies"
:
{
"
@ant-design-vue/tools
"
:
"
^3.0.4
"
,
"
@ant-design-vue/tools
"
:
"
^3.0.4
"
,
"
@babel/core
"
:
"
^7.12.9
"
,
"
@babel/plugin-proposal-export-default-from
"
:
"
^7.12.1
"
,
"
@babel/plugin-transform-object-assign
"
:
"
^7.12.1
"
,
"
@types/fs-extra
"
:
"
^9.0.2
"
,
"
@types/fs-extra
"
:
"
^9.0.2
"
,
"
@types/jest
"
:
"
^24.0.17
"
,
"
@types/jest
"
:
"
^24.0.17
"
,
"
@types/node
"
:
"
^13.13.15
"
,
"
@types/node
"
:
"
^13.13.15
"
,
...
@@ -43,13 +46,14 @@
...
@@ -43,13 +46,14 @@
"
@vue/eslint-config-prettier
"
:
"
^6.0.0
"
,
"
@vue/eslint-config-prettier
"
:
"
^6.0.0
"
,
"
@vue/eslint-config-typescript
"
:
"
^5.0.2
"
,
"
@vue/eslint-config-typescript
"
:
"
^5.0.2
"
,
"
@vue/test-utils
"
:
"
^2.0.0-beta.2
"
,
"
@vue/test-utils
"
:
"
^2.0.0-beta.2
"
,
"
babel-jest
"
:
"
^26.6.3
"
,
"
cross-env
"
:
"
^5.2.0
"
,
"
cross-env
"
:
"
^5.2.0
"
,
"
eslint
"
:
"
^6.7.2
"
,
"
eslint
"
:
"
^6.7.2
"
,
"
eslint-config-prettier
"
:
"
^6.15.0
"
,
"
eslint-config-prettier
"
:
"
^6.15.0
"
,
"
eslint-plugin-prettier
"
:
"
^3.1.3
"
,
"
eslint-plugin-prettier
"
:
"
^3.1.3
"
,
"
eslint-plugin-vue
"
:
"
^7.0.0-0
"
,
"
eslint-plugin-vue
"
:
"
^7.0.0-0
"
,
"
fs-extra
"
:
"
^9.0.1
"
,
"
fs-extra
"
:
"
^9.0.1
"
,
"
jest
"
:
"
^2
5.4.0
"
,
"
jest
"
:
"
^2
6.6.3
"
,
"
jest-environment-jsdom-fifteen
"
:
"
^1.0.2
"
,
"
jest-environment-jsdom-fifteen
"
:
"
^1.0.2
"
,
"
jest-serializer-vue
"
:
"
^2.0.2
"
,
"
jest-serializer-vue
"
:
"
^2.0.2
"
,
"
jest-transform-stub
"
:
"
^2.0.0
"
,
"
jest-transform-stub
"
:
"
^2.0.0
"
,
...
...
src/SiderMenu/SiderMenu.tsx
View file @
30e7632c
...
@@ -118,7 +118,7 @@ const SiderMenu: FunctionalComponent<SiderMenuProps> = (props: SiderMenuProps) =
...
@@ -118,7 +118,7 @@ const SiderMenu: FunctionalComponent<SiderMenuProps> = (props: SiderMenuProps) =
const
extraDom
=
menuExtraRender
&&
menuExtraRender
(
props
);
const
extraDom
=
menuExtraRender
&&
menuExtraRender
(
props
);
const
defaultMenuDom
=
(
const
defaultMenuDom
=
(
<
BaseMenu
<
BaseMenu
menu
s
=
{
menuData
}
menu
Data
=
{
menuData
}
theme=
{
props
.
theme
===
'realDark'
?
'dark'
:
props
.
theme
}
theme=
{
props
.
theme
===
'realDark'
?
'dark'
:
props
.
theme
}
mode=
"inline"
mode=
"inline"
collapsed=
{
props
.
collapsed
}
collapsed=
{
props
.
collapsed
}
...
...
tests/__snapshots__/global-footer.test.tsx.snap
0 → 100644
View file @
30e7632c
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`GlobalFooter 🥩 base use 1`] = `
<footer class="ant-pro-global-footer">
<div class="ant-pro-global-footer-links"><a title="1" target="_blank" href="https://www.github.com/vueComponent/pro-layout">Pro Layout</a><a title="2" target="_blank" href="https://www.github.com/vueComponent/ant-design-vue-pro">Github</a><a title="3" target="_blank" href="https://www.github.com/sendya/">@Sendya</a></div>
<div class="ant-pro-global-footer-copyright"><a href="https://github.com/vueComponent" target="_blank">vueComponent</a></div>
</footer>
`;
tests/global-footer.test.tsx
0 → 100644
View file @
30e7632c
import
{
mount
,
shallowMount
}
from
'@vue/test-utils'
;
// import BasicLayout from '../src/BasicLayout';
import
ProProvider
from
'../src/ProProvider'
;
import
GlobalFooter
from
'../src/GlobalFooter'
;
import
{
link
}
from
'fs'
;
const
testLinks
=
[
{
key
:
'1'
,
title
:
'Pro Layout'
,
href
:
'https://www.github.com/vueComponent/pro-layout'
,
blankTarget
:
true
,
},
{
key
:
'2'
,
title
:
'Github'
,
href
:
'https://www.github.com/vueComponent/ant-design-vue-pro'
,
blankTarget
:
true
,
},
{
key
:
'3'
,
title
:
'@Sendya'
,
href
:
'https://www.github.com/sendya/'
,
blankTarget
:
true
,
}
]
describe
(
'GlobalFooter'
,
()
=>
{
it
(
'🥩 base use'
,
()
=>
{
const
wrapper
=
mount
({
render
()
{
return
(<
GlobalFooter
links=
{
testLinks
}
copyright=
{
(<
a
href=
"https://github.com/vueComponent"
target=
"_blank"
>
vueComponent
</
a
>)
}
/>);
},
});
expect
(
wrapper
.
html
()).
toMatchSnapshot
();
});
it
(
'😄 custom links'
,
()
=>
{
const
wrapper
=
mount
({
render
()
{
return
(
<
GlobalFooter
links=
{
[{
key
:
'1'
,
title
:
'Pro Layout'
,
href
:
'https://www.github.com/vueComponent/pro-layout'
,
blankTarget
:
true
,
}]
}
/>
)
},
});
const
links
=
wrapper
.
findAll
(
'.ant-pro-global-footer-links a'
);
expect
(
links
).
toHaveLength
(
1
);
});
it
(
'😄 custom copyright'
,
()
=>
{
const
wrapper
=
mount
({
render
()
{
return
(
<
GlobalFooter
copyright=
{
(<
a
href=
"#copyright"
>
vueComponent
</
a
>)
}
/>
);
},
});
expect
(
wrapper
.
find
(
'.ant-pro-global-footer-copyright a'
).
attributes
()).
toHaveProperty
(
'href'
,
'#copyright'
);
});
});
tests/index.test.tsx
View file @
30e7632c
import
{
mount
}
from
'@vue/test-utils'
;
import
{
mount
,
shallowMount
}
from
'@vue/test-utils'
;
//
import BasicLayout from '../src/BasicLayout';
import
BasicLayout
from
'../src/BasicLayout'
;
describe
(
'BasicLayout'
,
()
=>
{
describe
(
'BasicLayout'
,
()
=>
{
it
(
'🥩 base use'
,
()
=>
{
it
(
'🥩 base use'
,
()
=>
{
// const wrapper = mount(BasicLayout, { });
// const wrapper = mount({
// render() {
// return (
// <BasicLayout />
// )
// },
// });
// console.log(wrapper.html());
// console.log(wrapper.html());
// expect(wrapper.html()).toMatchSnapshot();
});
});
});
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment