fix(editor): Hide version control main menu component if no feature flag (#6419)
* fix(editor): Hide version control main menu component if no feature flag * fix(editor): Update unit tes * test(editor): Test for feature flag
This commit is contained in:
@@ -28,7 +28,10 @@ const renderComponent = (renderOptions: Parameters<typeof render>[1] = {}) => {
|
||||
};
|
||||
|
||||
describe('MainSidebarVersionControl', () => {
|
||||
const getItemSpy = vi.spyOn(Storage.prototype, 'getItem');
|
||||
|
||||
beforeEach(() => {
|
||||
getItemSpy.mockReturnValue('true');
|
||||
pinia = createTestingPinia({
|
||||
initialState: {
|
||||
[STORES.SETTINGS]: {
|
||||
@@ -41,6 +44,12 @@ describe('MainSidebarVersionControl', () => {
|
||||
usersStore = useUsersStore();
|
||||
});
|
||||
|
||||
it('should render nothing', async () => {
|
||||
getItemSpy.mockReturnValue(null);
|
||||
const { container } = renderComponent({ props: { isCollapsed: false } });
|
||||
expect(container).toBeEmptyDOMElement();
|
||||
});
|
||||
|
||||
it('should render empty content', async () => {
|
||||
const { getByTestId } = renderComponent({ props: { isCollapsed: false } });
|
||||
expect(getByTestId('main-sidebar-version-control')).toBeInTheDocument();
|
||||
|
||||
Reference in New Issue
Block a user