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
1ed2b6ef
Unverified
Commit
1ed2b6ef
authored
Mar 01, 2021
by
Sendya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: test
parent
3304dca5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
2 deletions
+36
-2
BasicLayout.tsx
src/BasicLayout.tsx
+1
-1
index.test.tsx
tests/index.test.tsx
+35
-1
No files found.
src/BasicLayout.tsx
View file @
1ed2b6ef
...
...
@@ -86,7 +86,7 @@ const ProLayout: FunctionalComponent<BasicLayoutProps> = (props, { emit, slots }
return
{
[
baseClassName
.
value
]:
true
,
[
`screen-
${
colSize
.
value
}
`
]:
colSize
.
value
,
[
`
${
baseClassName
.
value
}
-top-menu`
]:
props
.
layout
===
'top'
,
[
`
${
baseClassName
.
value
}
-top-menu`
]:
isTop
.
value
,
[
`
${
baseClassName
.
value
}
-is-children`
]:
props
.
isChildrenLayout
,
[
`
${
baseClassName
.
value
}
-fix-siderbar`
]:
props
.
fixSiderbar
,
[
`
${
baseClassName
.
value
}
-
${
props
.
layout
}
`
]:
props
.
layout
,
...
...
tests/index.test.tsx
View file @
1ed2b6ef
import
'./_utils/mock-func'
;
import
{
mount
}
from
'@vue/test-utils'
;
import
{
mount
,
shallowMount
}
from
'@vue/test-utils'
;
import
{
reactive
}
from
'vue'
;
import
BasicLayout
from
'../src/BasicLayout'
;
const
title
=
'Pro Tests'
;
...
...
@@ -48,4 +49,37 @@ describe('BasicLayout', () => {
expect
(
renderTitle
.
element
.
innerHTML
).
toEqual
(
title
);
expect
(
renderLogo
.
attributes
()).
toHaveProperty
(
'src'
,
logoSrc
);
});
it
(
'😄 custom layout mode, navTheme'
,
async
()
=>
{
const
wrapper
=
mount
({
props
:
{
theme
:
{
type
:
String
,
default
:
'light'
,
},
layout
:
{
type
:
String
,
default
:
'mix'
,
},
},
render
()
{
return
(
<
BasicLayout
navTheme=
{
this
.
theme
}
layout=
{
this
.
layout
}
>
<
div
>
content
</
div
>
</
BasicLayout
>
);
},
});
expect
(
wrapper
.
find
(
'.ant-pro-basicLayout-mix'
).
exists
()).
toBe
(
true
);
expect
(
wrapper
.
find
(
'.ant-pro-sider-light'
).
exists
()).
toBe
(
true
);
// update props
await
wrapper
.
setProps
({
theme
:
'dark'
,
layout
:
'top'
,
});
expect
(
wrapper
.
find
(
'div.ant-pro-basicLayout-top'
).
exists
()).
toBe
(
true
);
expect
(
wrapper
.
find
(
'.ant-pro-top-nav-header.light'
).
exists
()).
toBe
(
false
);
});
});
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