-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into icons-new-july-august-2021
- Loading branch information
Showing
7 changed files
with
133 additions
and
14 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/** | ||
* Copyright IBM Corp. 2016, 2018 | ||
* | ||
* This source code is licensed under the Apache-2.0 license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
import 'carbon-components/scss/components/tabs/_tabs.scss'; | ||
|
||
import React from 'react'; | ||
import { mount } from '@cypress/react'; | ||
import Tabs from './Tabs'; | ||
import Tab from '../Tab/Tab'; | ||
import TabsSkeleton from './Tabs.Skeleton'; | ||
|
||
describe('Tabs', () => { | ||
beforeEach(() => { | ||
mount( | ||
<> | ||
<Tabs> | ||
<Tab label="Tab label 1"> | ||
<p>Content for first tab goes here.</p> | ||
</Tab> | ||
<Tab label="Tab label 2"> | ||
<p>Content for second tab goes here.</p> | ||
</Tab> | ||
<Tab label="Tab label 3" disabled> | ||
<p>Content for third tab goes here.</p> | ||
</Tab> | ||
<Tab | ||
label="Tab label 4 shows truncation" | ||
title="Tab label 4 shows truncation"> | ||
<p>Content for fourth tab goes here.</p> | ||
</Tab> | ||
</Tabs> | ||
<Tabs type="container"> | ||
<Tab label="Tab label 1"> | ||
<p>Yellow</p> | ||
</Tab> | ||
<Tab label="Tab label 2"> | ||
<p>Content for second tab goes here.</p> | ||
</Tab> | ||
<Tab | ||
label="Tab label 3 shows truncation" | ||
title="Tab label 3 shows truncation"> | ||
<p>Content for third tab goes here.</p> | ||
</Tab> | ||
<Tab label="Tab label 4" disabled> | ||
<p>Content for fourth container tab goes here.</p> | ||
</Tab> | ||
</Tabs> | ||
<TabsSkeleton type="default" /> | ||
<TabsSkeleton type="container" /> | ||
</> | ||
); | ||
}); | ||
|
||
it('should render', () => { | ||
cy.findByText('Yellow').should('be.visible'); | ||
|
||
// snapshots should always be taken _after_ an assertion that | ||
// a element/component should be visible. This is to ensure | ||
// the DOM has settled and the element has fully loaded. | ||
cy.percySnapshot(); | ||
}); | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/** | ||
* Copyright IBM Corp. 2016, 2018 | ||
* | ||
* This source code is licensed under the Apache-2.0 license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
import 'carbon-components/scss/components/tag/_tag.scss'; | ||
|
||
import React from 'react'; | ||
import { mount } from '@cypress/react'; | ||
import Tag from './Tag'; | ||
import TagSkeleton from './Tag.Skeleton'; | ||
import { Tag16 } from '@carbon/icons-react'; | ||
|
||
describe('Tag', () => { | ||
beforeEach(() => { | ||
mount( | ||
<> | ||
<Tag>This is a tag</Tag> | ||
<Tag onClick={() => {}}>This is an interactive tag</Tag> | ||
<Tag size="sm">This is a small tag</Tag> | ||
<Tag filter>This is a filter tag</Tag> | ||
<Tag renderIcon={Tag16}>Custom icon</Tag> | ||
<Tag filter disabled> | ||
Disabled filter tag | ||
</Tag> | ||
<Tag type="magenta">magenta</Tag> | ||
<Tag type="red">red</Tag> | ||
<Tag type="purple">purple</Tag> | ||
<Tag type="blue">blue</Tag> | ||
<Tag type="cyan">cyan</Tag> | ||
<Tag type="teal">teal</Tag> | ||
<Tag type="green">green</Tag> | ||
<Tag type="gray">gray</Tag> | ||
<Tag type="cool-gray">cool-gray</Tag> | ||
<Tag type="warm-gray">warm-gray</Tag> | ||
<Tag type="high-contrast">high-contrast</Tag> | ||
<TagSkeleton /> | ||
<TagSkeleton size="sm" /> | ||
</> | ||
); | ||
}); | ||
|
||
it('should render', () => { | ||
cy.findByText(/warm-gray/).should('be.visible'); | ||
|
||
// snapshots should always be taken _after_ an assertion that | ||
// a element/component should be visible. This is to ensure | ||
// the DOM has settled and the element has fully loaded. | ||
cy.percySnapshot(); | ||
}); | ||
}); |