Skip to content
代码片段 群组 项目
未验证 提交 15d3b818 编辑于 作者: Jacques Erasmus's avatar Jacques Erasmus 提交者: GitLab
浏览文件

Merge branch '499125-vue3-migration-super_sidebar_spec' into 'master'

Fix Vue 3 failing test for super_sidebar_spec

See merge request https://gitlab.com/gitlab-org/gitlab/-/merge_requests/169153



Merged-by: default avatarJacques Erasmus <jerasmus@gitlab.com>
Approved-by: default avatarJack Chapman <jachapman@gitlab.com>
Approved-by: default avatarJacques Erasmus <jerasmus@gitlab.com>
Reviewed-by: default avatarArtur Fedorov <afedorov@gitlab.com>
Co-authored-by: default avatarArtur Fedorov <afedorov@gitlab.com>
No related branches found
No related tags found
无相关合并请求
......@@ -126,7 +126,7 @@ describe('SuperSidebar component', () => {
it('adds inert attribute when collapsed', () => {
createWrapper({ sidebarState: { isCollapsed: true } });
expect(findSidebar().attributes('inert')).toBe('inert');
expect(findSidebar().attributes('inert')).toBeDefined();
});
it('does not add inert attribute when expanded', () => {
......@@ -271,7 +271,7 @@ describe('SuperSidebar component', () => {
it(`initially makes sidebar inert and peekable (${STATE_CLOSED})`, () => {
createWrapper({ sidebarState: { isCollapsed: true, isPeekable: true } });
expect(findSidebar().attributes('inert')).toBe('inert');
expect(findSidebar().attributes('inert')).toBeDefined();
expect(findSidebar().classes()).not.toContain(peekHintClass);
expect(findSidebar().classes()).not.toContain(hasPeekedClass);
expect(findSidebar().classes()).not.toContain(peekClass);
......@@ -283,7 +283,7 @@ describe('SuperSidebar component', () => {
findPeekBehavior().vm.$emit('change', STATE_WILL_OPEN);
await nextTick();
expect(findSidebar().attributes('inert')).toBe('inert');
expect(findSidebar().attributes('inert')).toBeDefined();
expect(findSidebar().classes()).toContain(peekHintClass);
expect(findSidebar().classes()).toContain(hasPeekedClass);
expect(findSidebar().classes()).not.toContain(peekClass);
......@@ -414,6 +414,7 @@ describe('SuperSidebar component', () => {
wrapper.vm.sidebarState.isCollapsed = false;
await nextTick();
await nextTick();
expect(focusSpy).toHaveBeenCalledTimes(1);
});
......@@ -432,6 +433,7 @@ describe('SuperSidebar component', () => {
wrapper.vm.sidebarState.isCollapsed = false;
await nextTick();
await nextTick();
expect(focusSpy).toHaveBeenCalledTimes(1);
......@@ -448,9 +450,10 @@ describe('SuperSidebar component', () => {
});
const ESC_KEY = 27;
it('collapses sidebar when sidebar is in overlay mode', () => {
it('collapses sidebar when sidebar is in overlay mode', async () => {
jest.spyOn(bp, 'windowWidth').mockReturnValue(lg);
findSidebar().trigger('keydown', { keyCode: ESC_KEY });
await findSidebar().trigger('keydown.esc', { keyCode: ESC_KEY });
expect(toggleSuperSidebarCollapsed).toHaveBeenCalled();
});
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册