Skip to content
Commits on Source (3)
# [105.6.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v105.5.0...v105.6.0) (2024-12-17)
### Features
* migrate GlInputGroupText ([eb12e80](https://gitlab.com/gitlab-org/gitlab-ui/commit/eb12e8089e766bec41744a42b668b12d7138d7da))
# [105.5.0](https://gitlab.com/gitlab-org/gitlab-ui/compare/v105.4.0...v105.5.0) (2024-12-16)
......
{
"name": "@gitlab/ui",
"version": "105.5.0",
"version": "105.6.0",
"description": "GitLab UI Components",
"license": "MIT",
"main": "dist/index.js",
......
### Under the hood
Uses [`BInputGroupText`](https://bootstrap-vue.org/docs/components/input-group#comp-ref-b-input-group-text)
from Vue Boostrap
GlInputGroupText components are used to add text to an input group.
......@@ -2,8 +2,26 @@ import { shallowMount } from '@vue/test-utils';
import GlInputGroupText from './input_group_text.vue';
describe('GlInputGroupText', () => {
it('renders main components', () => {
const wrapper = shallowMount(GlInputGroupText);
expect(wrapper).toBeInstanceOf(Object);
let wrapper;
const createWrapper = (slots) => {
wrapper = shallowMount(GlInputGroupText, {
slots,
});
};
it('uses "div" element', () => {
createWrapper();
expect(wrapper.element.tagName).toBe('DIV');
});
it('sets "input-group-text" css class', () => {
createWrapper();
expect(wrapper.classes()).toMatchObject(['input-group-text']);
});
it('renders content of default slot', () => {
createWrapper({ default: 'test' });
expect(wrapper.text()).toBe('test');
});
});
import BVueReadme from '../../../../vendor/bootstrap-vue/src/components/input-group/README.md';
import readme from './input_group_text.md';
import GlInputGroupText from './input_group_text.vue';
......@@ -21,8 +20,6 @@ export default {
title: 'base/form/input-group-text',
component: GlInputGroupText,
parameters: {
bootstrapDocs: BVueReadme,
bootstrapComponent: 'b-input-group',
controls: { disable: true },
docs: {
description: {
......
<script>
import { BInputGroupText } from '../../../../vendor/bootstrap-vue/src/components/input-group/input-group-text';
export default {
name: 'GlInputGroupText',
components: {
BInputGroupText,
},
inheritAttrs: false,
};
</script>
<template>
<b-input-group-text v-bind="$attrs" v-on="$listeners">
<div class="input-group-text">
<slot></slot>
</b-input-group-text>
</div>
</template>