Ghost/ghost/admin/tests/integration/components/posts/post-activity-feed/footer-links-test.js
Elena Baidakova 95c3a68c34
Updated the filter naming in Post Analytics (#15898)
closes TryGhost/Team#2329
- Replace 'Received' on 'Sent' in member's filter
- Moved links for feedback analytics from chart to table
2022-11-30 17:39:37 +04:00

55 lines
2.0 KiB
JavaScript

import {describe, it} from 'mocha';
import {expect} from 'chai';
import {find, render} from '@ember/test-helpers';
import {hbs} from 'ember-cli-htmlbars';
import {setupRenderingTest} from 'ember-mocha';
describe('Integration: Component: posts/post-activity-feed/footer-links', function () {
setupRenderingTest();
it('renders just one link if negative feedback > 0', async function () {
this.set('post', {id: 'id', count: {positive_feedback: 0, negative_feedback: 1}});
await render(hbs`
<Posts::PostActivityFeed::FooterLinks
@eventType="feedback"
@post={{this.post}}
/>`);
const link = find('.gh-post-activity-feed-pagination-link-wrapper');
expect(link).to.contain.text('Less like this');
expect(link).not.to.contain.text('and');
expect(link).not.to.contain.text('More like this');
});
it('renders just one link if positive feedback > 0', async function () {
this.set('post', {id: 'id', count: {positive_feedback: 1, negative_feedback: 0}});
await render(hbs`
<Posts::PostActivityFeed::FooterLinks
@eventType="feedback"
@post={{this.post}}
/>`);
const link = find('.gh-post-activity-feed-pagination-link-wrapper');
expect(link).not.to.contain.text('Less like this');
expect(link).not.to.contain.text('and');
expect(link).to.contain.text('More like this');
});
it('renders positive and negative links with separator', async function () {
this.set('post', {id: 'id', count: {positive_feedback: 1, negative_feedback: 1}});
await render(hbs`
<Posts::PostActivityFeed::FooterLinks
@eventType="feedback"
@post={{this.post}}
/>`);
const link = find('.gh-post-activity-feed-pagination-link-wrapper');
expect(link).to.contain.text('Less like this');
expect(link).to.contain.text('and');
expect(link).to.contain.text('More like this');
});
});