A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/bootstrap-vue/bootstrap-vue/commit/49a3f00420bf9958deda3a6be0ccb76cc3ea06ba below:

improve aside right handling (#5965) · bootstrap-vue/bootstrap-vue@49a3f00 · GitHub

@@ -9,15 +9,14 @@ describe('media', () => {

9 9

expect(wrapper.classes()).toContain('media')

10 10

expect(wrapper.classes().length).toBe(1)

11 11

expect(wrapper.findAll('.media-body').length).toBe(1)

12 -

expect(wrapper.findAll('.d-flex').length).toBe(0)

12 +

expect(wrapper.findAll('.media-aside').length).toBe(0)

13 13

expect(wrapper.text()).toEqual('')

14 -

// Should have only one child element

15 14

expect(wrapper.findAll('.media > *').length).toBe(1)

16 15 17 16

wrapper.destroy()

18 17

})

19 18 20 -

it('renders custom root element when tag prop set', async () => {

19 +

it('renders custom root element when `tag` prop set', async () => {

21 20

const wrapper = mount(BMedia, {

22 21

propsData: {

23 22

tag: 'section'

@@ -31,7 +30,7 @@ describe('media', () => {

31 30

wrapper.destroy()

32 31

})

33 32 34 -

it('has expected structure when slot aside present', async () => {

33 +

it('has expected structure when slot `aside` present', async () => {

35 34

const wrapper = mount(BMedia, {

36 35

slots: {

37 36

aside: 'foobar'

@@ -42,19 +41,15 @@ describe('media', () => {

42 41

expect(wrapper.classes()).toContain('media')

43 42

expect(wrapper.classes().length).toBe(1)

44 43

expect(wrapper.findAll('.media-body').length).toBe(1)

45 -

expect(wrapper.findAll('.d-flex').length).toBe(1)

46 -

// Should have only two child elements

44 +

expect(wrapper.findAll('.media-aside').length).toBe(1)

47 45

expect(wrapper.findAll('.media > *').length).toBe(2)

48 -

// Has expected child order

49 -

expect(wrapper.find('.media > .d-flex + .media-body').exists()).toBe(true)

50 -

expect(wrapper.find('.media > .media-body + .d-flex').exists()).toBe(false)

51 -

// Aside has extra classes

52 -

expect(wrapper.find('.d-flex').classes()).toContain('mr-3')

46 +

expect(wrapper.find('.media > .media-aside + .media-body').exists()).toBe(true)

47 +

expect(wrapper.find('.media > .media-body + .media-aside').exists()).toBe(false)

53 48 54 49

wrapper.destroy()

55 50

})

56 51 57 -

it('has expected structure when prop right-align is set and slot aside present', async () => {

52 +

it('has expected structure when prop `right-align` is set and slot `aside` present', async () => {

58 53

const wrapper = mount(BMedia, {

59 54

propsData: {

60 55

rightAlign: true

@@ -68,19 +63,15 @@ describe('media', () => {

68 63

expect(wrapper.classes()).toContain('media')

69 64

expect(wrapper.classes().length).toBe(1)

70 65

expect(wrapper.findAll('.media-body').length).toBe(1)

71 -

expect(wrapper.findAll('.d-flex').length).toBe(1)

72 -

// Should have only two child elements

66 +

expect(wrapper.findAll('.media-aside').length).toBe(1)

73 67

expect(wrapper.findAll('.media > *').length).toBe(2)

74 -

// Has expected child order

75 -

expect(wrapper.find('.media > .media-body + .d-flex').exists()).toBe(true)

76 -

expect(wrapper.find('.media > .d-flex + .media-body').exists()).toBe(false)

77 -

// Aside has extra classes

78 -

expect(wrapper.find('.d-flex').classes()).toContain('ml-3')

68 +

expect(wrapper.find('.media > .media-body + .media-aside').exists()).toBe(true)

69 +

expect(wrapper.find('.media > .media-aside + .media-body').exists()).toBe(false)

79 70 80 71

wrapper.destroy()

81 72

})

82 73 83 -

it('places default slot inside media-body', async () => {

74 +

it('places default slot inside `media-body`', async () => {

84 75

const wrapper = mount(BMedia, {

85 76

slots: {

86 77

default: '<b>foobar</b>'

@@ -97,7 +88,7 @@ describe('media', () => {

97 88

wrapper.destroy()

98 89

})

99 90 100 -

it('does not have child media-body is prop no-body set', async () => {

91 +

it('does not have child `media-body` when prop `no-body` set', async () => {

101 92

const wrapper = mount(BMedia, {

102 93

propsData: {

103 94

noBody: true

@@ -109,13 +100,12 @@ describe('media', () => {

109 100

expect(wrapper.classes().length).toBe(1)

110 101

expect(wrapper.findAll('.media-body').length).toBe(0)

111 102

expect(wrapper.text()).toEqual('')

112 -

// Should have no child elements

113 103

expect(wrapper.findAll('.media > *').length).toBe(0)

114 104 115 105

wrapper.destroy()

116 106

})

117 107 118 -

it('places default slot inside self when no-body set', async () => {

108 +

it('places default slot inside self when `no-body` set', async () => {

119 109

const wrapper = mount(BMedia, {

120 110

propsData: {

121 111

noBody: true

@@ -134,7 +124,7 @@ describe('media', () => {

134 124

wrapper.destroy()

135 125

})

136 126 137 -

it('sets verticalAlign prop on media-aside child', async () => {

127 +

it('sets `vertical-align` prop on `media-aside` child', async () => {

138 128

const wrapper = mount(BMedia, {

139 129

propsData: {

140 130

verticalAlign: 'bottom'

@@ -148,14 +138,11 @@ describe('media', () => {

148 138

expect(wrapper.classes()).toContain('media')

149 139

expect(wrapper.classes().length).toBe(1)

150 140

expect(wrapper.findAll('.media-body').length).toBe(1)

151 -

expect(wrapper.findAll('.d-flex').length).toBe(1)

141 +

expect(wrapper.findAll('.media-aside').length).toBe(1)

152 142

expect(wrapper.text()).toEqual('foobar')

153 -

// Should have only two child elements

154 143

expect(wrapper.findAll('.media > *').length).toBe(2)

155 -

// Should have media aside with self align bottom

156 -

expect(wrapper.find('.d-flex').classes()).toContain('align-self-end')

157 -

// Should have content in aside

158 -

expect(wrapper.find('.d-flex').text()).toEqual('foobar')

144 +

expect(wrapper.find('.media-aside').classes()).toContain('align-self-end')

145 +

expect(wrapper.find('.media-aside').text()).toEqual('foobar')

159 146 160 147

wrapper.destroy()

161 148

})


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4