Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
c3-closed
Project
Project
Details
Activity
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
charts
c3-closed
Commits
4f485048
Commit
4f485048
authored
Nov 28, 2014
by
Bob Renwick
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
adding a test to make sure the new updateLegend behaviour works
parent
c6d017dc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
0 deletions
+32
-0
legend-spec.js
spec/legend-spec.js
+32
-0
No files found.
spec/legend-spec.js
View file @
4f485048
...
...
@@ -151,4 +151,36 @@ describe('c3 chart legend', function () {
});
describe
(
'legend.show'
,
function
()
{
it
(
'should update args'
,
function
()
{
args
=
{
data
:
{
columns
:
[
[
'data1'
,
30
,
200
,
100
,
400
,
150
,
250
],
[
'data2'
,
130
,
100
,
200
,
100
,
250
,
150
]
]
},
legend
:
{
show
:
false
}
};
expect
(
true
).
toBeTruthy
();
});
it
(
'should not initially have rendered any legend items'
,
function
()
{
expect
(
d3
.
selectAll
(
'.c3-legend-item'
).
empty
()).
toBe
(
true
);
});
it
(
'allows us to show the legend on showLegend call'
,
function
()
{
chart
.
legend
.
show
();
d3
.
selectAll
(
'.c3-legend-item'
).
each
(
function
()
{
expect
(
d3
.
select
(
this
).
style
(
'visibility'
)).
toBe
(
'visible'
);
// This selects all the children, but we expect it to be empty
expect
(
d3
.
select
(
this
).
selectAll
(
"*"
).
length
).
not
.
toEqual
(
0
);
});
});
});
});
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