Commit eed652ba authored by Phil Hughes's avatar Phil Hughes

Merge branch '333115-impove-schedules-accessibility' into 'master'

Update oncall schedule component markup

See merge request gitlab-org/gitlab!66070
parents 7a9f4c03 4471f328
...@@ -175,8 +175,8 @@ export default { ...@@ -175,8 +175,8 @@ export default {
}, },
scheduleVisibleAriaLabel() { scheduleVisibleAriaLabel() {
return this.scheduleVisible return this.scheduleVisible
? this.$options.i18n.scheduleOpen ? this.$options.i18n.scheduleClose
: this.$options.i18n.scheduleClose; : this.$options.i18n.scheduleOpen;
}, },
scheduleVisibleAngleIcon() { scheduleVisibleAngleIcon() {
return this.scheduleVisible ? 'angle-down' : 'angle-right'; return this.scheduleVisible ? 'angle-down' : 'angle-right';
...@@ -240,22 +240,19 @@ export default { ...@@ -240,22 +240,19 @@ export default {
:header-class="{ 'gl-py-3': true, 'gl-rounded-small': !scheduleVisible }" :header-class="{ 'gl-py-3': true, 'gl-rounded-small': !scheduleVisible }"
> >
<template #header> <template #header>
<div <div class="gl-display-flex gl-align-items-center" data-testid="scheduleHeader">
class="gl-display-flex gl-justify-content-space-between gl-align-items-center gl-m-0" <gl-button
data-testid="scheduleHeader" v-gl-tooltip
> class="gl-mr-2 gl-p-0!"
<div class="gl-font-weight-bold gl-font-lg"> :title="scheduleVisibleAriaLabel"
<gl-icon :aria-label="scheduleVisibleAriaLabel"
v-gl-tooltip category="tertiary"
class="gl-hover-cursor-pointer" @click="scheduleVisible = !scheduleVisible"
:aria-label="scheduleVisibleAriaLabel" >
:size="12" <gl-icon :size="12" :name="scheduleVisibleAngleIcon" />
:name="scheduleVisibleAngleIcon" </gl-button>
@click="scheduleVisible = !scheduleVisible" <h3 class="gl-font-weight-bold gl-font-lg gl-m-0">{{ schedule.name }}</h3>
/> <gl-button-group class="gl-ml-auto">
<span class="gl-pl-2">{{ schedule.name }}</span>
</div>
<gl-button-group>
<gl-button <gl-button
v-gl-modal="editScheduleModalId" v-gl-modal="editScheduleModalId"
v-gl-tooltip v-gl-tooltip
......
import { GlButton, GlCard, GlIcon, GlCollapse } from '@gitlab/ui'; import { GlButton, GlCard, GlIcon, GlCollapse } from '@gitlab/ui';
import { shallowMount, createLocalVue } from '@vue/test-utils'; import { createLocalVue } from '@vue/test-utils';
import { nextTick } from 'vue'; import { nextTick } from 'vue';
import VueApollo from 'vue-apollo'; import VueApollo from 'vue-apollo';
import OnCallSchedule, { i18n } from 'ee/oncall_schedules/components/oncall_schedule.vue'; import OnCallSchedule, { i18n } from 'ee/oncall_schedules/components/oncall_schedule.vue';
...@@ -10,7 +10,7 @@ import { PRESET_TYPES } from 'ee/oncall_schedules/constants'; ...@@ -10,7 +10,7 @@ import { PRESET_TYPES } from 'ee/oncall_schedules/constants';
import getShiftsForRotationsQuery from 'ee/oncall_schedules/graphql/queries/get_oncall_schedules_with_rotations_shifts.query.graphql'; import getShiftsForRotationsQuery from 'ee/oncall_schedules/graphql/queries/get_oncall_schedules_with_rotations_shifts.query.graphql';
import * as commonUtils from 'ee/oncall_schedules/utils/common_utils'; import * as commonUtils from 'ee/oncall_schedules/utils/common_utils';
import createMockApollo from 'helpers/mock_apollo_helper'; import createMockApollo from 'helpers/mock_apollo_helper';
import { extendedWrapper } from 'helpers/vue_test_utils_helper'; import { shallowMountExtended } from 'helpers/vue_test_utils_helper';
import waitForPromises from 'helpers/wait_for_promises'; import waitForPromises from 'helpers/wait_for_promises';
import * as dateTimeUtility from '~/lib/utils/datetime/date_calculation_utility'; import * as dateTimeUtility from '~/lib/utils/datetime/date_calculation_utility';
import { getOncallSchedulesQueryResponse } from './mocks/apollo_mock'; import { getOncallSchedulesQueryResponse } from './mocks/apollo_mock';
...@@ -55,30 +55,28 @@ describe('On-call schedule', () => { ...@@ -55,30 +55,28 @@ describe('On-call schedule', () => {
[getShiftsForRotationsQuery, getShiftsForRotationsQueryHandler], [getShiftsForRotationsQuery, getShiftsForRotationsQueryHandler],
]); ]);
wrapper = extendedWrapper( wrapper = shallowMountExtended(OnCallSchedule, {
shallowMount(OnCallSchedule, { localVue,
localVue, apolloProvider: fakeApollo,
apolloProvider: fakeApollo, propsData: {
propsData: { schedule,
schedule, scheduleIndex,
scheduleIndex, ...props,
...props, },
}, data() {
data() { return {
return { rotations: schedule.rotations.nodes,
rotations: schedule.rotations.nodes, };
}; },
}, provide: {
provide: { timezones: mockTimezones,
timezones: mockTimezones, projectPath,
projectPath, ...provide,
...provide, },
}, stubs: {
stubs: { GlCard,
GlCard, },
}, });
}),
);
}; };
beforeEach(() => { beforeEach(() => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment