-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c69ac0c
commit 33cdf83
Showing
4 changed files
with
17 additions
and
15 deletions.
There are no files selected for viewing
26 changes: 14 additions & 12 deletions
26
packages/design-system/src/components/OcResourceIcon/OcResourceIcon.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,27 @@ | ||
import { shallowMount } from '@vue/test-utils' | ||
import { shallowMount } from 'web-test-helpers' | ||
import { AVAILABLE_SIZES } from '../../helpers/constants' | ||
import { OcResourceIcon } from '..' | ||
|
||
const resources = ['file', 'folder', 'space'] | ||
|
||
function getWrapper(props) { | ||
return shallowMount(OcResourceIcon, { | ||
propsData: { | ||
resource: { type: props.resourceType }, | ||
size: props.size | ||
} | ||
}) | ||
} | ||
|
||
describe('OcResourceIcon', () => { | ||
resources.forEach((resourceType) => { | ||
AVAILABLE_SIZES.forEach((size) => { | ||
it(`renders OcIcon for resource type ${resourceType} in size ${size}`, () => { | ||
const wrapper = getWrapper({ resourceType, size }) | ||
expect(wrapper).toMatchSnapshot() | ||
const { wrapper } = getWrapper({ resourceType, size }) | ||
expect(wrapper.html()).toMatchSnapshot() | ||
}) | ||
}) | ||
}) | ||
}) | ||
|
||
function getWrapper(props) { | ||
return { | ||
wrapper: shallowMount(OcResourceIcon as any, { | ||
props: { | ||
resource: { type: props.resourceType }, | ||
size: props.size | ||
} | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters