Add new test for read only news
This commit is contained in:
parent
d495136b05
commit
69d83d2cb0
|
|
@ -0,0 +1,43 @@
|
||||||
|
import {getMinimalMe} from '../../../support/helpers';
|
||||||
|
|
||||||
|
const getOperations = ({readOnly}) => ({
|
||||||
|
MeQuery: getMinimalMe({readOnly}),
|
||||||
|
NewsTeasers: {
|
||||||
|
newsTeasers: {
|
||||||
|
edges: [
|
||||||
|
{},
|
||||||
|
{},
|
||||||
|
{},
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('Read Only News', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.setup();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('displays the news', () => {
|
||||||
|
cy.mockGraphqlOps({
|
||||||
|
operations: getOperations({readOnly: false}),
|
||||||
|
});
|
||||||
|
|
||||||
|
cy.visit('/');
|
||||||
|
|
||||||
|
cy.getByDataCy('news-navigation-link').should('exist');
|
||||||
|
|
||||||
|
cy.getByDataCy('news-teasers').should('exist');
|
||||||
|
cy.getByDataCy('news-teaser').should('have.length', 2);
|
||||||
|
});
|
||||||
|
it('does not display the news', () => {
|
||||||
|
cy.mockGraphqlOps({
|
||||||
|
operations: getOperations({readOnly: true}),
|
||||||
|
});
|
||||||
|
|
||||||
|
cy.visit('/');
|
||||||
|
|
||||||
|
cy.getByDataCy('news-navigation-link').should('not.exist');
|
||||||
|
cy.getByDataCy('news-teasers').should('not.exist');
|
||||||
|
});
|
||||||
|
});
|
||||||
Loading…
Reference in New Issue