Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
coopwire-hypothesis
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
孙灵跃 Leon Sun
coopwire-hypothesis
Commits
38f8caa2
Commit
38f8caa2
authored
Oct 02, 2023
by
Alejandro Celaya
Committed by
Alejandro Celaya
Oct 02, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix ShareDialog test
parent
be2db7a3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
12 deletions
+6
-12
ShareDialog-test.js
src/sidebar/components/ShareDialog/test/ShareDialog-test.js
+6
-12
No files found.
src/sidebar/components/ShareDialog/test/ShareDialog-test.js
View file @
38f8caa2
import
{
Tab
}
from
'@hypothesis/frontend-shared'
;
import
{
mount
}
from
'enzyme'
;
import
{
mount
}
from
'enzyme'
;
import
{
checkAccessibility
}
from
'../../../../test-util/accessibility'
;
import
{
checkAccessibility
}
from
'../../../../test-util/accessibility'
;
...
@@ -59,14 +60,11 @@ describe('ShareDialog', () => {
...
@@ -59,14 +60,11 @@ describe('ShareDialog', () => {
});
});
function
selectTab
(
wrapper
,
name
)
{
function
selectTab
(
wrapper
,
name
)
{
wrapper
wrapper
.
find
(
`button[aria-controls="
${
name
}
-panel"]`
).
simulate
(
'click'
);
.
find
(
`Tab[aria-controls="
${
name
}
-panel"]`
)
.
find
(
'button'
)
.
simulate
(
'click'
);
}
}
function
getActiveTab
(
wrapper
)
{
function
getActiveTab
(
wrapper
)
{
return
wrapper
.
find
(
'Tab'
).
filter
({
selected
:
true
});
return
wrapper
.
find
(
Tab
).
filter
({
selected
:
true
});
}
}
function
activeTabPanel
(
wrapper
)
{
function
activeTabPanel
(
wrapper
)
{
...
@@ -79,18 +77,14 @@ describe('ShareDialog', () => {
...
@@ -79,18 +77,14 @@ describe('ShareDialog', () => {
assert
.
isFalse
(
wrapper
.
find
(
'TabHeader'
).
exists
());
assert
.
isFalse
(
wrapper
.
find
(
'TabHeader'
).
exists
());
});
});
[
[{
importTab
:
false
},
{
exportTab
:
false
},
{}].
forEach
(
props
=>
{
[{
shareTab
:
false
}],
[{
importTab
:
false
}],
[{
exportTab
:
false
}],
[{}],
].
forEach
(
props
=>
{
it
(
`renders a tabbed dialog when more than one tab is provided`
,
()
=>
{
it
(
`renders a tabbed dialog when more than one tab is provided`
,
()
=>
{
const
wrapper
=
createComponent
(
props
);
const
wrapper
=
createComponent
(
props
);
assert
.
isTrue
(
wrapper
.
find
(
'TabHeader'
).
exists
());
assert
.
isTrue
(
wrapper
.
find
(
'TabHeader'
).
exists
());
assert
.
isTrue
(
assert
.
isTrue
(
wrapper
.
find
(
'Tab[aria-controls="share-panel"]'
).
props
().
selected
,
wrapper
.
find
(
Tab
).
filter
(
'[aria-controls="share-panel"]'
).
props
()
.
selected
,
);
);
assert
.
isTrue
(
wrapper
.
find
(
'TabPanel[id="share-panel"]'
).
props
().
active
);
assert
.
isTrue
(
wrapper
.
find
(
'TabPanel[id="share-panel"]'
).
props
().
active
);
});
});
...
...
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