mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Update alertify alerts to use the styling defined in the styleguide (missed some files in the original commit).
This commit is contained in:
committed by
Dave Page
parent
2a30a86e7d
commit
f2d2075d81
41
web/regression/javascript/alerts/alertify_wrapper_spec.js
Normal file
41
web/regression/javascript/alerts/alertify_wrapper_spec.js
Normal file
@@ -0,0 +1,41 @@
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// pgAdmin 4 - PostgreSQL Tools
|
||||
//
|
||||
// Copyright (C) 2013 - 2017, The pgAdmin Development Team
|
||||
// This software is released under the PostgreSQL Licence
|
||||
//
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
import alertify from '../../../pgadmin/static/vendor/alertifyjs/alertify';
|
||||
import AlertifyWrapper from '../../../pgadmin/static/js/alerts/alertify_wrapper';
|
||||
|
||||
describe('alertify_wrapper', function () {
|
||||
describe('success', function () {
|
||||
it('calls the success function from alertify and adds the checkmark to the element', function () {
|
||||
spyOn(alertify, 'success');
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
|
||||
alertifyWrapper.success('Yay, congrats!', 1);
|
||||
|
||||
var calledWithMessage = alertify.success.calls.mostRecent().args[0];
|
||||
|
||||
expect(calledWithMessage).toContain('Yay, congrats!');
|
||||
expect(calledWithMessage).toContain('class="fa fa-check"');
|
||||
});
|
||||
});
|
||||
|
||||
describe('error', function () {
|
||||
it('calls the error function from alertify and adds the warning symbol to the element', function () {
|
||||
spyOn(alertify, 'error');
|
||||
var alertifyWrapper = new AlertifyWrapper();
|
||||
|
||||
alertifyWrapper.error('bad, very bad', 1);
|
||||
|
||||
var calledWithMessage = alertify.error.calls.mostRecent().args[0];
|
||||
|
||||
expect(calledWithMessage).toContain('bad, very bad');
|
||||
expect(calledWithMessage).toContain('class="fa fa-exclamation-triangle"');
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user