Rollback visibility rules cleanup (#4426)

* Revert "[ACS-9369] Updated rule-migration-guide.md to include missed rule (#4420)"

This reverts commit b3e2af7f0f.

* Revert "[ACS-9369] Resolved issues where visibility rules with a single element array would log errors (#4416)"

This reverts commit 4e33f1126d.

* Revert "[ACS-8694] Cleanup of visibility rules for extensions in ACA (#4140)"

This reverts commit f1c4dcf45d.
This commit is contained in:
swapnil-verma-gl
2025-03-03 16:56:13 +05:30
committed by GitHub
parent 4e37f194ac
commit 2efea8c6d8
18 changed files with 1130 additions and 930 deletions

View File

@@ -59,6 +59,28 @@ describe('navigation.evaluators', () => {
});
});
describe('isNotFavorites', () => {
it('should return [true] if url is not `/favorites`', () => {
const context: any = {
navigation: {
url: '/some/path'
}
};
expect(app.isNotFavorites(context)).toBe(true);
});
it('should return [false] if url starts with `/favorites`', () => {
const context: any = {
navigation: {
url: '/favorites/path'
}
};
expect(app.isNotFavorites(context)).toBe(false);
});
});
describe('isSharedFiles', () => {
it('should return [true] if path starts with `/shared`', () => {
const context: any = {
@@ -81,6 +103,28 @@ describe('navigation.evaluators', () => {
});
});
describe('isNotSharedFiles', () => {
it('should return [true] if path does not contain `/shared`', () => {
const context: any = {
navigation: {
url: '/some/path/'
}
};
expect(app.isNotSharedFiles(context)).toBe(true);
});
it('should return [false] if path contains `/shared`', () => {
const context: any = {
navigation: {
url: '/shared/path/'
}
};
expect(app.isNotSharedFiles(context)).toBe(false);
});
});
describe('isTrashcan', () => {
it('should return [true] if url starts with `/trashcan`', () => {
const context: any = {
@@ -103,6 +147,28 @@ describe('navigation.evaluators', () => {
});
});
describe('isNotTrashcan', () => {
it('should return [true] if url does not start with `/trashcan`', () => {
const context: any = {
navigation: {
url: '/path/trashcan'
}
};
expect(app.isNotTrashcan(context)).toBe(true);
});
it('should return [false] if url does start with `/trashcan`', () => {
const context: any = {
navigation: {
url: '/trashcan'
}
};
expect(app.isNotTrashcan(context)).toBe(false);
});
});
describe('isPersonalFiles', () => {
it('should return [true] if url starts with `/personal-files`', () => {
const context: any = {
@@ -147,6 +213,18 @@ describe('navigation.evaluators', () => {
});
});
describe('isNotLibraries', () => {
it('should return [true] if url does not end with `/libraries`', () => {
const context: any = {
navigation: {
url: '/libraries/path'
}
};
expect(app.isNotLibraries(context)).toBe(true);
});
});
describe('isDetails', () => {
it('should return true if url includes with `/details`', () => {
const context: any = {
@@ -169,6 +247,28 @@ describe('navigation.evaluators', () => {
});
});
describe('isNotDetails', () => {
it('should return true if url does not include `/details`', () => {
const context: any = {
navigation: {
url: '/path'
}
};
expect(app.isNotDetails(context)).toBe(true);
});
it('should return false if url includes `/details`', () => {
const context: any = {
navigation: {
url: 'personal-files/details/path'
}
};
expect(app.isNotDetails(context)).toBe(false);
});
});
describe('isRecentFiles', () => {
it('should return [true] if url starts with `/recent-files`', () => {
const context: any = {
@@ -212,4 +312,90 @@ describe('navigation.evaluators', () => {
expect(app.isSearchResults(context)).toBe(false);
});
});
describe('isSharedPreview', () => {
it('should return [true] if url starts with `/shared` and contains `viewer:view', () => {
const context: any = {
navigation: {
url: '/shared/(viewer:view)'
}
};
expect(app.isSharedPreview(context)).toBe(true);
});
it('should return [false] if url does not start with `/shared`', () => {
const context: any = {
navigation: {
url: '/path/shared/(viewer:view)'
}
};
expect(app.isSharedPreview(context)).toBe(false);
});
it('should return [false] if url starts with `/shared` and does not includes `viewer:view`', () => {
const context: any = {
navigation: {
url: '/shared/something'
}
};
expect(app.isSharedPreview(context)).toBe(false);
});
});
describe('isFavoritesPreview', () => {
it('should return [true] if url starts with `/favorites` and includes `viewer:view`', () => {
const context: any = {
navigation: {
url: '/favorites/(viewer:view)'
}
};
expect(app.isFavoritesPreview(context)).toBe(true);
});
it('should return [false] if url does not start with `/favorites`', () => {
const context: any = {
navigation: {
url: '/path/favorites/(viewer:view)'
}
};
expect(app.isFavoritesPreview(context)).toBe(false);
});
it('should return [false] if url starts with `/favorites` and does not include `viewer:view`', () => {
const context: any = {
navigation: {
url: '/favorites/other'
}
};
expect(app.isFavoritesPreview(context)).toBe(false);
});
});
describe('isSharedFileViewer', () => {
it('should return [true] if url starts with `/preview/s/`', () => {
const context: any = {
navigation: {
url: '/preview/s/path'
}
};
expect(app.isSharedFileViewer(context)).toBe(true);
});
it('should return [false] if url does not start with `/preview/s/`', () => {
const context: any = {
navigation: {
url: '/path/preview/s/'
}
};
expect(app.isSharedFileViewer(context)).toBe(false);
});
});
});