Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
8160e68f
Commit
8160e68f
authored
Nov 17, 2017
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: build & tests
parent
7b17d134
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
71 additions
and
76 deletions
+71
-76
jest.config.js
+1
-1
public/app/core/components/search/search.html
+17
-17
public/app/features/dashboard/specs/save_as_modal.jest.ts
+53
-58
No files found.
jest.config.js
View file @
8160e68f
module
.
exports
=
{
module
.
exports
=
{
verbose
:
tru
e
,
verbose
:
fals
e
,
"globals"
:
{
"globals"
:
{
"ts-jest"
:
{
"ts-jest"
:
{
"tsConfigFile"
:
"tsconfig.json"
"tsConfigFile"
:
"tsconfig.json"
...
...
public/app/core/components/search/search.html
View file @
8160e68f
...
@@ -51,27 +51,27 @@
...
@@ -51,27 +51,27 @@
</a>
</a>
</div>
</div>
</div>
</div>
</div>
<div
class=
"search-results-container"
ng-if=
"!ctrl.tagsMode"
>
<div
class=
"search-results-container"
ng-if=
"!ctrl.tagsMode"
>
<h6
ng-hide=
"ctrl.results.length"
>
No dashboards matching your query were found.
</h6>
<h6
ng-hide=
"ctrl.results.length"
>
No dashboards matching your query were found.
</h6>
<div
ng-repeat=
"row in ctrl.results"
>
<div
ng-repeat=
"row in ctrl.results"
>
<a
class=
"search-item search-item--{{::row.type}}"
ng-class=
"{'selected': $index == ctrl.selectedIndex}"
ng-href=
"{{row.url}}"
>
<a
class=
"search-item search-item--{{::row.type}}"
ng-class=
"{'selected': $index == ctrl.selectedIndex}"
ng-href=
"{{row.url}}"
>
<span
class=
"search-result-tags"
>
<span
class=
"search-result-tags"
>
<span
ng-click=
"ctrl.filterByTag(tag, $event)"
ng-repeat=
"tag in row.tags"
tag-color-from-name=
"tag"
class=
"label label-tag"
>
<span
ng-click=
"ctrl.filterByTag(tag, $event)"
ng-repeat=
"tag in row.tags"
tag-color-from-name=
"tag"
class=
"label label-tag"
>
{{tag}}
{{tag}}
</span>
</span>
<span
ng-click=
"ctrl.starDashboard(row, $event)"
>
<span
ng-click=
"ctrl.starDashboard(row, $event)"
>
<i
class=
"fa"
ng-class=
"{'fa-star': row.isStarred, 'fa-star-o': !row.isStarred}"
></i>
<i
class=
"fa"
ng-class=
"{'fa-star': row.isStarred, 'fa-star-o': !row.isStarred}"
></i>
</span>
</span>
</span>
</span>
<span
class=
"search-result-link"
>
<span
class=
"search-result-link"
>
<i
class=
"fa search-result-icon"
></i>
<i
class=
"fa search-result-icon"
></i>
{{::row.title}}
{{::row.title}}
</span>
</span>
</a>
</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
...
...
public/app/features/dashboard/specs/save_as_modal.jest.ts
View file @
8160e68f
import
{
SaveDashboardAsModalCtrl
}
from
'../save_as_modal'
;
import
{
SaveDashboardAsModalCtrl
}
from
'../save_as_modal'
;
import
{
describe
,
it
,
expect
}
from
'test/lib/common'
;
import
{
describe
,
it
,
expect
}
from
'test/lib/common'
;
describe
(
'saving dashboard as'
,
()
=>
{
describe
(
'saving dashboard as'
,
()
=>
{
function
scenario
(
name
,
panel
,
verify
)
{
function
scenario
(
name
,
panel
,
verify
)
{
describe
(
name
,
()
=>
{
describe
(
name
,
()
=>
{
var
json
=
{
var
json
=
{
title
:
"name"
,
title
:
'name'
,
rows
:
[
{
panels
:
[
panels
:
[
panel
],
panel
};
]}]
};
var
mockDashboardSrv
=
{
getCurrent
:
function
()
{
var
mockDashboardSrv
=
{
return
{
getCurrent
:
function
()
{
id
:
5
,
return
{
meta
:
{},
id
:
5
,
getSaveModelClone
:
function
()
{
getSaveModelClone
:
function
()
{
return
json
;
return
json
;
},
}
};
};
},
}
};
};
var
ctrl
=
new
SaveDashboardAsModalCtrl
(
mockDashboardSrv
);
var
ctrl
=
new
SaveDashboardAsModalCtrl
(
mockDashboardSrv
);
var
ctx
:
any
=
{
var
ctx
:
any
=
{
clone
:
ctrl
.
clone
,
clone
:
ctrl
.
clone
,
ctrl
:
ctrl
,
ctrl
:
ctrl
,
panel
:
panel
panel
:
{}
};
};
for
(
let
row
of
ctrl
.
clone
.
rows
)
{
it
(
'verify'
,
()
=>
{
for
(
let
panel
of
row
.
panels
)
{
verify
(
ctx
);
ctx
.
panel
=
panel
;
});
}
}
it
(
"verify"
,
()
=>
{
verify
(
ctx
);
});
});
}
scenario
(
"default values"
,
{},
(
ctx
)
=>
{
var
clone
=
ctx
.
clone
;
expect
(
clone
.
id
).
toBe
(
null
);
expect
(
clone
.
title
).
toBe
(
"name Copy"
);
expect
(
clone
.
editable
).
toBe
(
true
);
expect
(
clone
.
hideControls
).
toBe
(
false
);
});
});
}
var
graphPanel
=
{
id
:
1
,
type
:
"graph"
,
alert
:
{
rule
:
1
},
thresholds
:
{
value
:
3000
}
};
scenario
(
'default values'
,
{},
ctx
=>
{
var
clone
=
ctx
.
clone
;
expect
(
clone
.
id
).
toBe
(
null
);
expect
(
clone
.
title
).
toBe
(
'name Copy'
);
expect
(
clone
.
editable
).
toBe
(
true
);
expect
(
clone
.
hideControls
).
toBe
(
false
);
});
scenario
(
"should remove alert from graph panel"
,
graphPanel
,
(
ctx
)
=>
{
var
graphPanel
=
{
id
:
1
,
type
:
'graph'
,
alert
:
{
rule
:
1
},
thresholds
:
{
value
:
3000
}
};
expect
(
ctx
.
panel
.
alert
).
toBe
(
undefined
);
});
scenario
(
"should remove threshold from graph panel"
,
graphPanel
,
(
ctx
)
=>
{
scenario
(
'should remove alert from graph panel'
,
graphPanel
,
ctx
=>
{
expect
(
ctx
.
panel
.
thresholds
).
toBe
(
undefined
);
expect
(
ctx
.
panel
.
alert
).
toBe
(
undefined
);
});
});
scenario
(
"singlestat should keep threshold"
,
{
id
:
1
,
type
:
"singlestat"
,
thresholds
:
{
value
:
3000
}
},
(
ctx
)
=>
{
scenario
(
'should remove threshold from graph panel'
,
graphPanel
,
ctx
=>
{
expect
(
ctx
.
panel
.
thresholds
).
not
.
toBe
(
undefined
);
expect
(
ctx
.
panel
.
thresholds
)
.
toBe
(
undefined
);
});
});
scenario
(
"table should keep threshold"
,
{
id
:
1
,
type
:
"table"
,
thresholds
:
{
value
:
3000
}
},
(
ctx
)
=>
{
scenario
(
'singlestat should keep threshold'
,
{
id
:
1
,
type
:
'singlestat'
,
thresholds
:
{
value
:
3000
}
},
ctx
=>
{
expect
(
ctx
.
panel
.
thresholds
).
not
.
toBe
(
undefined
);
expect
(
ctx
.
panel
.
thresholds
).
not
.
toBe
(
undefined
);
});
});
scenario
(
'table should keep threshold'
,
{
id
:
1
,
type
:
'table'
,
thresholds
:
{
value
:
3000
}
},
ctx
=>
{
expect
(
ctx
.
panel
.
thresholds
).
not
.
toBe
(
undefined
);
});
});
});
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