12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- import {
- moduleFor,
- test
- } from 'ember-qunit';
- moduleFor('component:forum-footer', 'FooterComponent');
- test('it exists', function(assert) {
- assert.expect(1);
- var component = this.subject();
- assert.ok(component);
- });
- test('showTermsLink', function(assert) {
- assert.expect(4);
- var component = this.subject();
- // ToS isn't defined and there isn't link to remote ToS page, don't show link
- component.set('settings', {'terms_of_service': null, 'terms_of_service_link': ''});
- assert.ok(!component.get('showTermsLink'));
- // ToS is defined but there isn't link to remote ToS page, show link
- component.set('settings', {'terms_of_service': true, 'terms_of_service_link': ''});
- assert.ok(component.get('showTermsLink'));
- // ToS isn't defined but there is link to remote ToS page, show link
- component.set('settings', {'terms_of_service': null, 'terms_of_service_link': 'http://somewhere.com'});
- assert.ok(component.get('showTermsLink'));
- // ToS is defined and there is link to remote ToS page, show link
- component.set('settings', {'terms_of_service': true, 'terms_of_service_link': 'http://somewhere.com'});
- assert.ok(component.get('showTermsLink'));
- });
- test('showPrivacyLink', function(assert) {
- assert.expect(4);
- var component = this.subject();
- // PrivPolicy isn't defined and there isn't link to remote PrivPolicy page, don't show link
- component.set('settings', {'privacy_policy': null, 'privacy_policy_link': ''});
- assert.ok(!component.get('showPrivacyLink'));
- // PrivPolicy is defined but there isn't link to remote PrivPolicy page, show link
- component.set('settings', {'privacy_policy': true, 'privacy_policy_link': ''});
- assert.ok(component.get('showPrivacyLink'));
- // PrivPolicy isn't defined but there is link to remote PrivPolicy page, show link
- component.set('settings', {'privacy_policy': null, 'privacy_policy_link': 'http://somewhere.com'});
- assert.ok(component.get('showPrivacyLink'));
- // PrivPolicy is defined and there is link to remote PrivPolicy page, show link
- component.set('settings', {'privacy_policy': true, 'privacy_policy_link': 'http://somewhere.com'});
- assert.ok(component.get('showPrivacyLink'));
- });
- test('hasContent', function(assert) {
- assert.expect(4);
- var component = this.subject();
- // no Privacy Policy or ToS, don't show footer nav
- component.set('settings', {
- 'terms_of_service': null, 'terms_of_service_link': '',
- 'privacy_policy': null, 'privacy_policy_link': ''
- });
- assert.ok(!component.get('hasContent'));
- // Privacy Policy but no ToS, don't show footer nav
- component.set('settings', {
- 'terms_of_service': null, 'terms_of_service_link': '',
- 'privacy_policy': true, 'privacy_policy_link': ''
- });
- assert.ok(component.get('hasContent'));
- // no Privacy Policy but ToS, don't show footer nav
- component.set('settings', {
- 'terms_of_service': null, 'terms_of_service_link': 'http://somewhere.com',
- 'privacy_policy': null, 'privacy_policy_link': ''
- });
- assert.ok(component.get('hasContent'));
- // Privacy Policy and ToS, don't show footer nav
- component.set('settings', {
- 'terms_of_service': null, 'terms_of_service_link': 'http://somewhere.com',
- 'privacy_policy': null, 'privacy_policy_link': 'http://somewhere.com'
- });
- assert.ok(component.get('hasContent'));
- });
|