Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

Commit

Permalink
feat: adds badge component
Browse files Browse the repository at this point in the history
  • Loading branch information
tewshi authored and kelsos committed Sep 18, 2023
1 parent 16e7656 commit 202059a
Show file tree
Hide file tree
Showing 14 changed files with 1,323 additions and 3 deletions.
29 changes: 29 additions & 0 deletions example/cypress/e2e/overlays/badge.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// https://docs.cypress.io/api/introduction/api.html

describe('Badge', () => {
beforeEach(() => {
cy.visit('/badges');
});

it('checks for and trigger badge', () => {
cy.contains('h2[data-cy=badges]', 'Badges');

cy.get('div[data-cy=badge-0]').as('defaultBadge');
cy.get('@defaultBadge').find('div[role=status]').should('exist');

cy.get('@defaultBadge').find('> button').click();
cy.get('@defaultBadge').find('div[role=status]').should('not.exist');
cy.get('@defaultBadge').find('> button').click();
cy.get('@defaultBadge').find('div[role=status]').should('exist');
});

it('checks for and trigger dot badge', () => {
cy.get('div[data-cy=badge-84]').as('dotBadge');
cy.get('@dotBadge').find('div[role=status]').should('exist');

cy.get('@dotBadge').find('> button').click();
cy.get('@dotBadge').find('div[role=status]').should('not.exist');
cy.get('@dotBadge').find('> button').click();
cy.get('@dotBadge').find('div[role=status]').should('exist');
});
});
1 change: 1 addition & 0 deletions example/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const navigation = ref([
{ to: { name: 'data-tables' }, title: 'Data Tables' },
{ to: { name: 'cards' }, title: 'Cards' },
{ to: { name: 'tabs' }, title: 'Tabs' },
{ to: { name: 'badges' }, title: 'Badges' },
],
},
]);
Expand Down
2 changes: 2 additions & 0 deletions example/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
RiInformationLine,
RiMacbookLine,
RiMoonLine,
RiStarFill,
RiSunLine,
RuiPlugin,
} from '@rotki/ui-library-compat';
Expand All @@ -29,6 +30,7 @@ Vue.use(PiniaVuePlugin);
Vue.use(RuiPlugin, {
icons: [
RiMoonLine,
RiStarFill,
RiSunLine,
RiMacbookLine,
RiArrowLeftLine,
Expand Down
5 changes: 5 additions & 0 deletions example/src/router/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ const router = new VueRouter({
name: 'tabs',
component: () => import('@/views/TabView.vue'),
},
{
path: '/badges',
name: 'badges',
component: () => import('@/views/BadgeView.vue'),
},
],
});

Expand Down
Loading

0 comments on commit 202059a

Please sign in to comment.