-
Notifications
You must be signed in to change notification settings - Fork 3
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
2537176
commit 2227b89
Showing
23 changed files
with
2,472 additions
and
1,212 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// https://docs.cypress.io/api/introduction/api.html | ||
|
||
describe('Tabs', () => { | ||
beforeEach(() => { | ||
cy.visit('/tabs'); | ||
}); | ||
|
||
it('check for rendered tabs', () => { | ||
cy.contains('h2[data-cy=tabs]', 'Tabs'); | ||
|
||
cy.get('[data-cy=wrapper-0]').as('wrapper'); | ||
|
||
cy.get('@wrapper') | ||
.find('[data-cy=tabs]') | ||
.find('[role=tablist]') | ||
.as('tablist'); | ||
|
||
cy.get('@tablist').children().should('have.length', 6); | ||
cy.get('@tablist') | ||
.find('button:first-child') | ||
.should('have.class', 'active-tab'); | ||
cy.get('@tablist').find('button:nth-child(2)').should('be.disabled'); | ||
|
||
cy.get('@wrapper').find('[data-cy=tab-items]').as('tabcontent'); | ||
|
||
cy.get('@tabcontent').should('have.text', 'Tab 1 Content'); | ||
|
||
// Click third tab | ||
cy.get('@tablist').find('button:nth-child(3)').click(); | ||
cy.get('@tabcontent').should('have.text', 'Tab 3 Content'); | ||
|
||
// Click last tab should redirect to stepper page | ||
cy.get('@tablist').find('a:last-child').click(); | ||
|
||
cy.url().should('contain', '/steppers'); | ||
}); | ||
}); |
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,107 @@ | ||
<script setup lang="ts"> | ||
import { | ||
RuiCard, | ||
RuiIcon, | ||
RuiTab, | ||
RuiTabItem, | ||
RuiTabItems, | ||
RuiTabs, | ||
} from '@rotki/ui-library-compat'; | ||
import { ref } from 'vue'; | ||
import { type DataType } from '@/types'; | ||
type TabsData = DataType<typeof RuiTabs, string>; | ||
const tabs = ref<TabsData[]>([ | ||
{ | ||
color: 'primary', | ||
}, | ||
{ | ||
color: 'secondary', | ||
}, | ||
{ | ||
color: 'error', | ||
}, | ||
{ | ||
color: 'warning', | ||
}, | ||
{ | ||
color: 'info', | ||
}, | ||
{ | ||
color: 'success', | ||
}, | ||
{ | ||
color: 'primary', | ||
vertical: true, | ||
}, | ||
{ | ||
color: 'secondary', | ||
vertical: true, | ||
}, | ||
{ | ||
color: 'error', | ||
vertical: true, | ||
}, | ||
{ | ||
color: 'warning', | ||
vertical: true, | ||
}, | ||
{ | ||
color: 'info', | ||
vertical: true, | ||
}, | ||
{ | ||
color: 'success', | ||
vertical: true, | ||
}, | ||
]); | ||
</script> | ||
|
||
<template> | ||
<div> | ||
<h2 class="text-h4 mb-6" data-cy="tabs">Tabs</h2> | ||
<div | ||
v-for="(data, i) in tabs" | ||
:key="i" | ||
class="flex mb-6 gap-x-6" | ||
:class="data.vertical ? 'flex-row' : 'flex-col'" | ||
:data-cy="`wrapper-${i}`" | ||
> | ||
<RuiTabs v-bind="data" v-model="data.modelValue" data-cy="tabs"> | ||
<RuiTab> | ||
<template #prepend> | ||
<RuiIcon name="add-fill" /> | ||
</template> | ||
Tab 1 | ||
</RuiTab> | ||
<RuiTab disabled>Tab 2</RuiTab> | ||
<RuiTab>Tab 3</RuiTab> | ||
<RuiTab>Tab 4</RuiTab> | ||
<RuiTab>Tab 5</RuiTab> | ||
<RuiTab link to="/steppers">Stepper View</RuiTab> | ||
</RuiTabs> | ||
<RuiTabItems v-model="data.modelValue" data-cy="tab-items"> | ||
<RuiTabItem> | ||
<RuiCard>Tab 1 Content</RuiCard> | ||
</RuiTabItem> | ||
<RuiTabItem> | ||
<RuiCard>Tab 2 Content</RuiCard> | ||
</RuiTabItem> | ||
<RuiTabItem> | ||
<RuiCard>Tab 3 Content</RuiCard> | ||
</RuiTabItem> | ||
<RuiTabItem> | ||
<RuiCard>Tab 4 Content</RuiCard> | ||
</RuiTabItem> | ||
<RuiTabItem> | ||
<RuiCard> | ||
Tab 5 Long Long Long Long Long Long Long Long Long Long Long Long | ||
Long Long Long Long Long Long Long Long Long Long Long Long Long | ||
Long Long Long Long Long Long Long Long Content | ||
</RuiCard> | ||
</RuiTabItem> | ||
</RuiTabItems> | ||
</div> | ||
</div> | ||
</template> |
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
Oops, something went wrong.