Skip to content

Commit

Permalink
Update Section tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Sundfjord committed Aug 23, 2023
1 parent d5137ac commit 260b043
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 14 deletions.
2 changes: 1 addition & 1 deletion packages/dnb-eufemia/src/components/section/Section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export default function Section(localProps: SectionAllProps) {
const params = {
className: classnames(
'dnb-section',
`dnb-section--${variant ?? (style_type || 'default')}`,
`dnb-section--${variant ?? (style_type || 'default')}`,
spacing &&
`dnb-section--spacing-${isTrue(spacing) ? 'large' : spacing}`,
createSpacingClasses(props),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe('Section component', () => {

expect(Array.from(element.classList)).toEqual([
'dnb-section',
'dnb-section--mint-green-12',
'dnb-section--default',
'dnb-space__top--medium',
])
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ exports[`Section scss have to match default theme snapshot 1`] = `
.dnb-section--transparent::after {
color: transparent;
}
.dnb-section--mint-green-12 {
.dnb-section--mint-green-12, .dnb-section--default {
color: var(--color-black-80);
}
.dnb-section--mint-green-12::after {
.dnb-section--mint-green-12::after, .dnb-section--default::after {
color: var(--color-mint-green-12);
}
.dnb-section--white {
Expand All @@ -121,16 +121,16 @@ exports[`Section scss have to match default theme snapshot 1`] = `
.dnb-section--lavender::after {
color: var(--color-lavender);
}
.dnb-section--sand-yellow {
.dnb-section--sand-yellow, .dnb-section--warning {
color: var(--color-black-80);
}
.dnb-section--sand-yellow::after {
.dnb-section--sand-yellow::after, .dnb-section--warning::after {
color: var(--color-sand-yellow);
}
.dnb-section--pistachio {
.dnb-section--pistachio, .dnb-section--info {
color: var(--color-black-80);
}
.dnb-section--pistachio::after {
.dnb-section--pistachio::after, .dnb-section--info::after {
color: var(--color-pistachio);
}
.dnb-section--black-3 {
Expand All @@ -157,25 +157,31 @@ exports[`Section scss have to match default theme snapshot 1`] = `
.dnb-section--fire-red::after {
color: var(--color-fire-red);
}
.dnb-section--fire-red-8 {
.dnb-section--fire-red-8, .dnb-section--error {
color: var(--color-black-80);
}
.dnb-section--fire-red-8::after {
.dnb-section--fire-red-8::after, .dnb-section--error::after {
color: var(--color-fire-red-8);
}
.dnb-section--fire-red .dnb-anchor, .dnb-section--emerald-green .dnb-anchor, .dnb-section--sea-green .dnb-anchor {
.dnb-section--success {
color: var(--color-white);
}
.dnb-section--fire-red .dnb-anchor:hover, .dnb-section--emerald-green .dnb-anchor:hover, .dnb-section--sea-green .dnb-anchor:hover {
.dnb-section--success::after {
color: var(--color-success-green);
}
.dnb-section--fire-red .dnb-anchor, .dnb-section--emerald-green .dnb-anchor, .dnb-section--sea-green .dnb-anchor, .dnb-section--success .dnb-anchor {
color: var(--color-white);
}
.dnb-section--fire-red .dnb-anchor:hover, .dnb-section--emerald-green .dnb-anchor:hover, .dnb-section--sea-green .dnb-anchor:hover, .dnb-section--success .dnb-anchor:hover {
color: var(--color-emerald-green);
box-shadow: inset 100vw 100vw 0 0 var(--color-white), -0.125em 0 0 0 var(--color-white), 0.125em 0 0 0 var(--color-white);
}
.dnb-section--fire-red .dnb-anchor:active, .dnb-section--emerald-green .dnb-anchor:active, .dnb-section--sea-green .dnb-anchor:active {
.dnb-section--fire-red .dnb-anchor:active, .dnb-section--emerald-green .dnb-anchor:active, .dnb-section--sea-green .dnb-anchor:active, .dnb-section--success .dnb-anchor:active {
color: var(--color-white);
background-color: transparent;
box-shadow: inset 100vw 100vw 0 0 transparent, -0.125em 0 0 0 transparent, 0.125em 0 0 0 transparent;
}
.dnb-section--fire-red .dnb-anchor:focus-visible, .dnb-section--emerald-green .dnb-anchor:focus-visible, .dnb-section--sea-green .dnb-anchor:focus-visible {
.dnb-section--fire-red .dnb-anchor:focus-visible, .dnb-section--emerald-green .dnb-anchor:focus-visible, .dnb-section--sea-green .dnb-anchor:focus-visible, .dnb-section--success .dnb-anchor:focus-visible {
color: var(--color-white);
background-color: transparent;
outline: none;
Expand Down

0 comments on commit 260b043

Please sign in to comment.