mirror of
https://github.com/discourse/discourse.git
synced 2025-06-05 14:07:30 +08:00
UX: Convert buttons to d-button
This commit is contained in:
@ -2,11 +2,12 @@ import componentTest from 'helpers/component-test';
|
||||
moduleForComponent('d-button', {integration: true});
|
||||
|
||||
componentTest('icon only button', {
|
||||
template: '{{d-button icon="plus"}}',
|
||||
template: '{{d-button icon="plus" tabindex="3"}}',
|
||||
|
||||
test(assert) {
|
||||
assert.ok(this.$('button.btn.btn-icon.no-text').length, 'it has all the classes');
|
||||
assert.ok(this.$('button .d-icon.d-icon-plus').length, 'it has the icon');
|
||||
assert.equal(this.$('button').attr('tabindex'), "3", 'it has the tabindex');
|
||||
}
|
||||
});
|
||||
|
||||
|
16
test/javascripts/components/share-button-test.js.es6
Normal file
16
test/javascripts/components/share-button-test.js.es6
Normal file
@ -0,0 +1,16 @@
|
||||
import componentTest from 'helpers/component-test';
|
||||
moduleForComponent('share-button', {integration: true});
|
||||
|
||||
componentTest('share button', {
|
||||
template: '{{share-button url="https://eviltrout.com"}}',
|
||||
|
||||
test(assert) {
|
||||
assert.ok(this.$(`button.share`).length, 'it has all the classes');
|
||||
|
||||
assert.ok(
|
||||
this.$(`button[data-share-url="https://eviltrout.com"]`).length,
|
||||
'it has the data attribute for sharing'
|
||||
);
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user