Skip to content

Commit b235959

Browse files
committed
tests(bootstrap): add test covering conflict on styling td's
1 parent 4d3a732 commit b235959

File tree

3 files changed

+53
-5
lines changed

3 files changed

+53
-5
lines changed

bower.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
],
88
"description": "Make your HTML tables look great on every device",
99
"main": [
10-
"release/angular-responsive-tables.js",
11-
"release/angular-responsive-tables.css"
12-
],
10+
"release/angular-responsive-tables.js",
11+
"release/angular-responsive-tables.css"
12+
],
1313
"keywords": [
1414
"angular",
1515
"angularjs",
@@ -32,6 +32,7 @@
3232
},
3333
"devDependencies": {
3434
"angular-mocks": "^1.3.4",
35-
"jquery": "~2.1.4"
35+
"jquery": "~2.1.4",
36+
"bootstrap": "*"
3637
}
3738
}

karma.conf.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ module.exports = function(config) {
1818
'bower_components/jquery/dist/jquery.js',
1919
'bower_components/angular/angular.js',
2020
'bower_components/angular-mocks/angular-mocks.js',
21+
'bower_components/bootstrap/dist/css/bootstrap.css',
2122
'src/**/*.js',
23+
'src/**/*.css',
2224
'tests/**/*.spec.js'
2325
],
2426

@@ -59,7 +61,17 @@ module.exports = function(config) {
5961

6062
// start these browsers
6163
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
62-
browsers: ['Chrome'],
64+
browsers: ['mobile'],
65+
66+
customLaunchers: {
67+
mobile: {
68+
base: "Chrome",
69+
flags: ["--window-size=320,600"]
70+
},
71+
desktop: {
72+
base: "Chrome"
73+
}
74+
},
6375

6476

6577
// Continuous Integration mode

tests/directive.spec.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,39 @@ describe('directive', function () {
8282
expect(firstDataRow.eq(2).attr('data-title')).toBe('Third title');
8383
expect(firstDataRow.eq(3).attr('data-title')).toBe('Forth title');
8484
});
85+
86+
fit('supports bootstrap', function () {
87+
var markup = [
88+
'<table wt-responsive-table class="table" style="display: none;">',
89+
' <thead>',
90+
' <tr>',
91+
' <th>First title</th>',
92+
' <th>Second title</th>',
93+
' <th>Third title</th>',
94+
' <th>Forth title</th>',
95+
' </tr>',
96+
' </thead>',
97+
' <tbody>',
98+
' <tr>',
99+
' <td>First column</td>',
100+
' <td>Second column</td>',
101+
' <td>Third column</td>',
102+
' <td>Forth column</td>',
103+
' </tr>',
104+
' </tbody>',
105+
'</table>'
106+
].join('');
107+
var element = angular.element(markup);
108+
angular.element("body").append(element);
109+
110+
var firstDataRow = element.find('tbody tr td');
111+
112+
var styles = getComputedStyle(firstDataRow[0]);
113+
expect(styles.paddingLeft).toBe('8px');
114+
115+
$compile(element);
116+
$rootScope.$digest();
117+
118+
expect(styles.paddingLeft).toBe('50%');
119+
});
85120
});

0 commit comments

Comments
 (0)