mirror of https://github.com/BTCPrivate/copay.git
fix in updateVersion with tests
This commit is contained in:
parent
a7cba1197a
commit
9c24b45f4c
|
@ -603,6 +603,10 @@ ul.pagination li.current a:hover, ul.pagination li.current a:focus {
|
|||
background: #16A085;
|
||||
}
|
||||
|
||||
.alert-box a {
|
||||
color:white;
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 40em) {
|
||||
|
||||
#main, .header-content {
|
||||
|
|
|
@ -75,9 +75,9 @@
|
|||
|
||||
<div class="row" ng-if="updateVersion">
|
||||
<div class="small-9 large-centered columns">
|
||||
<div data-alert class="alert-box radius {{updateVersion}}">
|
||||
A newer version of Copay is now available, please update your wallet to a latest version.
|
||||
Please check <a href="http://www.copay.io">Copay.io</a>.
|
||||
<div data-alert class="alert-box radius {{updateVersion.class}}">
|
||||
A newer version of Copay is now available ({{updateVersion.version}}), please update your wallet.
|
||||
Check <a href="http://www.copay.io">Copay.io</a> for details.
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -26,11 +26,10 @@ angular.module('copayApp.controllers').controller('HeaderController',
|
|||
var latestVersion = data[0].name.replace('v', '').split('.').map(toInt);
|
||||
var currentVersion = copay.version.split('.').map(toInt);
|
||||
if (currentVersion[0] < latestVersion[0]){
|
||||
$scope.updateVersion = 'error';
|
||||
$scope.updateVersion = {class: 'error', version:data[0].name};
|
||||
} else if (currentVersion[0] == latestVersion[0] && currentVersion[1] < latestVersion[1]) {
|
||||
$scope.updateVersion = 'info';
|
||||
} else
|
||||
$scope.updateVersion = 'ok';
|
||||
$scope.updateVersion = {class: 'info', version:data[0].name};
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
|
|
@ -101,7 +101,8 @@ describe("Unit: Controllers", function() {
|
|||
$httpBackend.expectGET(GH);
|
||||
scope.$apply();
|
||||
$httpBackend.flush();
|
||||
expect(scope.updateVersion).equal('error');
|
||||
expect(scope.updateVersion.class).equal('error');
|
||||
expect(scope.updateVersion.version).equal('v100.1.6');
|
||||
});
|
||||
|
||||
it('should check blockChainStatus', function() {
|
||||
|
|
Loading…
Reference in New Issue