Commit 6ecb4aa8 authored by Andrew Fontaine's avatar Andrew Fontaine

Merge branch 'add-devops-adoption-table-cell-flag-component' into 'master'

Add DevopsAdoptionTableCellFlag component

See merge request gitlab-org/gitlab!47376
parents c3666eeb add58701
<script>
export default {
name: 'DevopsAdoptionTableCellFlag',
props: {
enabled: {
type: Boolean,
required: true,
},
},
};
</script>
<template>
<span class="circle" :class="{ 'circle-enabled': enabled }"></span>
</template>
@import '../../../../../app/assets/stylesheets/page_bundles/dev_ops_report';
.circle {
width: $gl-spacing-scale-3;
height: $gl-spacing-scale-3;
border: 1px solid var(--gray-300, $gray-300);
border-radius: $avatar-radius;
@include gl-display-inline-block;
&-enabled {
border: 1px solid var(--indigo-800, $indigo-800);
background-color: var(--indigo-600, $indigo-600);
}
}
import { shallowMount } from '@vue/test-utils';
import DevopsAdoptionTableCellFlag from 'ee/admin/dev_ops_report/components/devops_adoption_table_cell_flag.vue';
describe('DevopsAdoptionTableCellFlag', () => {
let wrapper;
const createComponent = props => {
wrapper = shallowMount(DevopsAdoptionTableCellFlag, {
propsData: {
enabled: true,
...props,
},
});
};
afterEach(() => {
wrapper.destroy();
wrapper = null;
});
it('contains the circle-enabled class when enabled', () => {
createComponent();
expect(wrapper.classes()).toContain('circle');
expect(wrapper.classes()).toContain('circle-enabled');
});
it('does not contain the circle-enabled class when disabled', () => {
createComponent({ enabled: false });
expect(wrapper.classes()).toContain('circle');
expect(wrapper.classes()).not.toContain('circle-enabled');
});
});
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