Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

Commit

Permalink
Use oficial angular repos for Bower dependencies, and PhantomJS.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mateu Aguiló Bosch committed Nov 28, 2013
1 parent 5347a17 commit e89e841
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 30 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
KARMA = ./node_modules/karma/bin/karma start test/karma.conf.js --browsers Firefox --single-run
KARMA = ./node_modules/karma/bin/karma start test/karma.conf.js --browsers PhantomJS --single-run

install:; @npm install

Expand Down
20 changes: 11 additions & 9 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
{
"name" : "message-center",
"version" : "1.0.0",
"description" : "AngularJS Message Center",
"keywords" : [ "angular", "js", "messages", "alert", "bootstrap" ],
"author" : "Mateu Aguiló Bosch <mateu.aguilo.bosch@gmail.com>",
"readmeFilename" : "README.md",
"dependencies" : {
"angular" : "~1.2.0"
"name" : "message-center",
"version" : "1.0.0",
"description" : "AngularJS Message Center",
"keywords" : [ "angular", "js", "messages", "alert", "bootstrap" ],
"author" : "Mateu Aguiló Bosch <mateu.aguilo.bosch@gmail.com>",
"readmeFilename" : "README.md",
"dependencies" : {
"angular" : "~1.2.0",
"angular-route" : "~1.2.0",
"angular-mocks" : "~1.2.0"
},
"ignore" : [ "**/.*", "node_modules", "test" ]
"ignore" : [ "**/.*", "node_modules", "test" ]
}
2 changes: 1 addition & 1 deletion test/app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html>
<head>
<script src="components/angular/angular.js"></script>
<script src="components/angular/angular-route.js"></script>
<script src="components/angular-route/angular-route.js"></script>
<script src="message-center.js"></script>
<script>
angular.module('messageCenter.e2e', ['MessageCenterModule', 'ngRoute'])
Expand Down
4 changes: 2 additions & 2 deletions test/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ module.exports = function(config) { config.set({
urlRoot : '/_karma_/',
frameworks : ['ng-scenario', 'mocha'],
files : [
'app/components/angular/angular-mocks.js',
'app/components/angular-mocks/angular-mocks.js',
'scenarios.js'
],
reporters : ['dots'],
logLevel : config.LOG_ERROR,

browsers : ['Firefox'],
browsers : ['PhantomJS'],
captureTimeout: 10000
});};
34 changes: 17 additions & 17 deletions test/scenarios.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,35 +16,35 @@ describe('Message Center', function() {
element('#saveSuccess').click();
var messages = element('div#mc-messages-wrapper .alert');
expect(messages.count()).toBe(1);
expect(messages.prop('className')).toEqual('alert fade in alert-success');
expect(messages.prop('className')).toEqual('alert alert-success fade in');
expect(messages.text()).toMatch('Saved successfully!');
});

it('renders a message with the level and text provided', function() {
element('#saveFailure').click();
var messages = element('div#mc-messages-wrapper .alert');
expect(messages.count()).toBe(1);
expect(messages.prop('className')).toEqual('alert fade in alert-danger');
expect(messages.prop('className')).toEqual('alert alert-danger fade in');
expect(messages.text()).toMatch('Something went wrong!');
});

it('renders multiple messages with the default "success" level and text', function() {
element('#saveMultipleSuccess').click();
var yay = element('div#mc-messages-wrapper .alert:first');
expect(yay.prop('className')).toEqual('alert fade in alert-success');
expect(yay.prop('className')).toEqual('alert alert-success fade in');
expect(yay.text()).toMatch('Yay!');
var saved = element('div#mc-messages-wrapper .alert:nth-of-type(2)');
expect(saved.prop('className')).toEqual('alert fade in alert-success');
expect(saved.prop('className')).toEqual('alert alert-success fade in');
expect(saved.text()).toMatch('Saved successfully!');
});

it('renders multiple messages with the level and text provided', function() {
element('#saveMultipleTypes').click();
var yay = element('div#mc-messages-wrapper .alert:first');
expect(yay.prop('className')).toEqual('alert fade in alert-success');
expect(yay.prop('className')).toEqual('alert alert-success fade in');
expect(yay.text()).toMatch('Yay!');
var somethingWrong = element('div#mc-messages-wrapper .alert:nth-of-type(2)');
expect(somethingWrong.prop('className')).toEqual('alert fade in alert-danger');
expect(somethingWrong.prop('className')).toEqual('alert alert-danger fade in');
expect(somethingWrong.text()).toMatch('Something went wrong!');
});
});
Expand All @@ -55,35 +55,35 @@ describe('Message Center', function() {
element('#goEditSuccess').click();
var messages = element('div#mc-messages-wrapper .alert');
expect(messages.count()).toBe(1);
expect(messages.prop('className')).toEqual('alert fade in alert-success');
expect(messages.prop('className')).toEqual('alert alert-success fade in');
expect(messages.text()).toMatch('You have reached the edit page!');
});

it('renders a message with the level and text provided', function() {
element('#goEditFailure').click();
var messages = element('div#mc-messages-wrapper .alert');
expect(messages.count()).toBe(1);
expect(messages.prop('className')).toEqual('alert fade in alert-danger');
expect(messages.prop('className')).toEqual('alert alert-danger fade in');
expect(messages.text()).toMatch('Something went wrong!');
});

it('renders multiple messages with the default "success" level and text', function() {
element('#goEditMultipleSuccess').click();
var yay = element('div#mc-messages-wrapper .alert:first');
expect(yay.prop('className')).toEqual('alert fade in alert-success');
expect(yay.prop('className')).toEqual('alert alert-success fade in');
expect(yay.text()).toMatch('Yay!');
var youveReached = element('div#mc-messages-wrapper .alert:nth-of-type(2)');
expect(youveReached.prop('className')).toEqual('alert fade in alert-success');
expect(youveReached.prop('className')).toEqual('alert alert-success fade in');
expect(youveReached.text()).toMatch('You have reached the edit page!');
});

it('renders multiple messages with the level and text provided', function() {
element('#goEditMultipleTypes').click();
var yay = element('div#mc-messages-wrapper .alert:first');
expect(yay.prop('className')).toEqual('alert fade in alert-success');
expect(yay.prop('className')).toEqual('alert alert-success fade in');
expect(yay.text()).toMatch('Yay!');
var somethingWrong = element('div#mc-messages-wrapper .alert:nth-of-type(2)');
expect(somethingWrong.prop('className')).toEqual('alert fade in alert-danger');
expect(somethingWrong.prop('className')).toEqual('alert alert-danger fade in');
expect(somethingWrong.text()).toMatch('Something went wrong!');
});
});
Expand All @@ -95,31 +95,31 @@ describe('Message Center', function() {
it('still renders a permanent message', function () {
var messages = element('div#mc-messages-wrapper .alert');
expect(messages.count()).toBe(1);
expect(messages.prop('className')).toEqual('alert fade in alert-success');
expect(messages.prop('className')).toEqual('alert alert-success fade in');
expect(messages.text()).toMatch('Showing permanent message!');
element('#goIndex').click();
element('#goPermanent').click();
element('#goIndex').click();
messages = element('div#mc-messages-wrapper .alert');
expect(messages.count()).toBe(2);
var message = element('div#mc-messages-wrapper .alert:first');
expect(message.prop('className')).toEqual('alert fade in alert-success');
expect(message.prop('className')).toEqual('alert alert-success fade in');
expect(message.text()).toMatch('Showing permanent message!');
messages = element('div#mc-messages-wrapper .alert');
message = element('div#mc-messages-wrapper .alert:nth-of-type(2)');
expect(messages.count()).toBe(2);
expect(message.prop('className')).toEqual('alert fade in alert-success');
expect(message.prop('className')).toEqual('alert alert-success fade in');
expect(message.text()).toMatch('Showing permanent message!');
});
it('renders a permanent message and then closes it', function () {
var messages = element('div#mc-messages-wrapper .alert');
expect(messages.count()).toBe(1);
expect(messages.prop('className')).toEqual('alert fade in alert-success');
expect(messages.prop('className')).toEqual('alert alert-success fade in');
expect(messages.text()).toMatch('Showing permanent message!');
element('#goIndex').click();
messages = element('div#mc-messages-wrapper .alert');
expect(messages.count()).toBe(1);
expect(messages.prop('className')).toEqual('alert fade in alert-success');
expect(messages.prop('className')).toEqual('alert alert-success fade in');
expect(messages.text()).toMatch('Showing permanent message!');
element('div#mc-messages-wrapper .alert .close').click();
messages = element('div#mc-messages-wrapper .alert');
Expand Down

0 comments on commit e89e841

Please sign in to comment.