feat(v4): Update the help center portal design (#10296)
Co-authored-by: Pranav <pranavrajs@gmail.com>
This commit is contained in:
@@ -53,8 +53,8 @@ describe('#mutations', () => {
|
||||
current_page: 1,
|
||||
});
|
||||
expect(state.meta).toEqual({
|
||||
count: 3,
|
||||
currentPage: 1,
|
||||
articles_count: 3,
|
||||
current_page: 1,
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -71,22 +71,36 @@ describe('#mutations', () => {
|
||||
});
|
||||
|
||||
describe('#UPDATE_ARTICLE', () => {
|
||||
it('does not updates if empty object is passed', () => {
|
||||
it('does not update if empty object is passed', () => {
|
||||
mutations[types.UPDATE_ARTICLE](state, {});
|
||||
expect(state).toEqual(article);
|
||||
});
|
||||
it('does not updates if object id is not present ', () => {
|
||||
|
||||
it('does not update if object id is not present in the state', () => {
|
||||
mutations[types.UPDATE_ARTICLE](state, { id: 5 });
|
||||
expect(state).toEqual(article);
|
||||
});
|
||||
it(' updates if object with id already present in the state', () => {
|
||||
mutations[types.UPDATE_ARTICLE](state, {
|
||||
|
||||
it('updates if object with id is already present in the state', () => {
|
||||
const updatedArticle = {
|
||||
id: 2,
|
||||
title: 'How do I change my registered email address',
|
||||
});
|
||||
expect(state.articles.byId[2].title).toEqual(
|
||||
'How do I change my registered email address'
|
||||
);
|
||||
title: 'Updated Title',
|
||||
content: 'Updated Content',
|
||||
};
|
||||
mutations[types.UPDATE_ARTICLE](state, updatedArticle);
|
||||
expect(state.articles.byId[2].title).toEqual('Updated Title');
|
||||
expect(state.articles.byId[2].content).toEqual('Updated Content');
|
||||
});
|
||||
|
||||
it('preserves the original position when updating an article', () => {
|
||||
const originalPosition = state.articles.byId[2].position;
|
||||
const updatedArticle = {
|
||||
id: 2,
|
||||
title: 'Updated Title',
|
||||
content: 'Updated Content',
|
||||
};
|
||||
mutations[types.UPDATE_ARTICLE](state, updatedArticle);
|
||||
expect(state.articles.byId[2].position).toEqual(originalPosition);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user