feat(v4): Update the help center portal design (#10296)

Co-authored-by: Pranav <pranavrajs@gmail.com>
This commit is contained in:
Sivin Varghese
2024-10-24 10:39:36 +05:30
committed by GitHub
parent 6d3ecfe3c1
commit a3855a8d1d
144 changed files with 6376 additions and 6604 deletions

View File

@@ -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);
});
});