mirror of
https://github.com/discourse/discourse-subscriptions.git
synced 2025-07-09 07:33:28 +00:00
initial spec for donation-row component
This commit is contained in:
parent
d0bdfab44b
commit
abaf101173
@ -2,11 +2,11 @@
|
|||||||
<span>{{i18n 'discourse_donations.invoice_prefix'}}</span>
|
<span>{{i18n 'discourse_donations.invoice_prefix'}}</span>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
<span>{{currency}}</span>
|
<span class="donation-row-currency">{{currency}}</span>
|
||||||
|
|
||||||
<span>{{amount}}</span>
|
<span class="donation-row-amount">{{amount}}</span>
|
||||||
|
|
||||||
<span>{{period}}</span>
|
<span class="donation-row-period">{{period}}</span>
|
||||||
|
|
||||||
{{#if invoice}}
|
{{#if invoice}}
|
||||||
<a href='{{data.invoiceLink}}' target='_blank'>({{i18n 'discourse_donations.invoice'}})</a>
|
<a href='{{data.invoiceLink}}' target='_blank'>({{i18n 'discourse_donations.invoice'}})</a>
|
||||||
@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
{{#if currentUser}}
|
{{#if currentUser}}
|
||||||
{{#if subscription}}
|
{{#if subscription}}
|
||||||
|
<span class="donation-row-subscription">
|
||||||
{{#if updating}}
|
{{#if updating}}
|
||||||
{{loading-spinner size='small'}}
|
{{loading-spinner size='small'}}
|
||||||
{{else}}
|
{{else}}
|
||||||
@ -23,6 +24,7 @@
|
|||||||
</a>
|
</a>
|
||||||
{{/unless}}
|
{{/unless}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
</span>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
|
@ -1,15 +0,0 @@
|
|||||||
import { acceptance } from 'helpers/qunit-helpers';
|
|
||||||
|
|
||||||
acceptance('Discourse Donations', {
|
|
||||||
loggedIn: true,
|
|
||||||
settings: {
|
|
||||||
discourse_donations_enabled: true,
|
|
||||||
discourse_donations_types: '',
|
|
||||||
discourse_donations_amounts: '1',
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
QUnit.test("donate page has a form on it", async assert => {
|
|
||||||
await visit("/donate");
|
|
||||||
assert.ok(exists(".donations-page-donations"));
|
|
||||||
});
|
|
26
test/javascripts/components/donation-row-test.js.es6
Normal file
26
test/javascripts/components/donation-row-test.js.es6
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
import componentTest from 'helpers/component-test';
|
||||||
|
|
||||||
|
moduleForComponent('donation-row', { integration: true });
|
||||||
|
|
||||||
|
componentTest('donation-row', {
|
||||||
|
template: `{{donation-row currency=3 amount=21 period='monthly'}}`,
|
||||||
|
|
||||||
|
test(assert) {
|
||||||
|
assert.equal(find('.donation-row-currency').text(), '3');
|
||||||
|
assert.equal(find('.donation-row-amount').text(), '21');
|
||||||
|
assert.equal(find('.donation-row-period').text(), 'monthly');
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
componentTest('donation-row cancels subscription', {
|
||||||
|
template: `{{donation-row currentUser=currentUser subscription=subscription}}`,
|
||||||
|
|
||||||
|
beforeEach() {
|
||||||
|
this.set('currentUser', true);
|
||||||
|
this.set('subscription', true);
|
||||||
|
},
|
||||||
|
|
||||||
|
async test(assert) {
|
||||||
|
assert.ok(find('.donation-row-subscription').length);
|
||||||
|
},
|
||||||
|
});
|
Loading…
x
Reference in New Issue
Block a user