Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions src/shared/services/json-store.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ describe('JsonStoreService', () => {
service.rollbackLastChange();
});

it('shoul set json patches and group them by path', () => {
it('should set json patches and group them by path', () => {
const patches = [
{
path: '/p/1',
Expand Down Expand Up @@ -335,7 +335,7 @@ describe('JsonStoreService', () => {
service.setJsonPatches(patches);
});

it('shoul return true for parent if a child has a patch', () => {
it('should return true for parent if a child has a patch', () => {
const patches = [
{
path: '/parent/children/0',
Expand All @@ -351,7 +351,7 @@ describe('JsonStoreService', () => {
expect(service.hasPatchOrChildrenHavePatch('/parent')).toBe(true);
});

it('shoul return true for parent if it has a patch', () => {
it('should return true for parent if it has a patch', () => {
const patches = [
{
path: '/parent',
Expand All @@ -367,7 +367,7 @@ describe('JsonStoreService', () => {
expect(service.hasPatchOrChildrenHavePatch('/parent')).toBe(true);
});

it('shoul return false for parent if it or a child does not have a patch', () => {
it('should return false for parent if it or a child does not have a patch', () => {
const patches = [
{
path: '/other/thing',
Expand All @@ -377,4 +377,10 @@ describe('JsonStoreService', () => {
service.setJsonPatches(patches);
expect(service.hasPatchOrChildrenHavePatch('/parent')).toBe(false);
});

it('should return false if patch is undefiled', () => {
const patches = undefined;
service.setJsonPatches(patches);
expect(service.hasPatchOrChildrenHavePatch('/parent')).toBe(false);
});
});