-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #195 from OnroerendErfgoed/feature/105_no_rows_ove…
…rlay_component Feature/105 no rows overlay component
- Loading branch information
Showing
4 changed files
with
67 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { defineComponent } from 'vue'; | ||
import NoRowsOverlay from '@/components/dumb/NoRowsOverlay.vue'; | ||
|
||
describe('NoRowsOverlay', () => { | ||
const TestComponent = defineComponent({ | ||
components: { NoRowsOverlay }, | ||
data: () => { | ||
return { | ||
params: { | ||
noRowsMessage: 'No rows available', | ||
}, | ||
}; | ||
}, | ||
template: '<no-rows-overlay :params="params"/>', | ||
}); | ||
|
||
beforeEach(() => { | ||
cy.mount(TestComponent); | ||
}); | ||
|
||
it('has a wrapper with class ag-overlay-loading-center', () => { | ||
cy.dataCy('ag-overlay').should('have.class', 'ag-overlay-loading-center'); | ||
}); | ||
|
||
it('renders a warning icon', () => { | ||
cy.dataCy('warning-icon').should('exist').should('have.attr', 'data-icon', 'circle-exclamation'); | ||
}); | ||
|
||
it('renders the given no rows message', () => { | ||
cy.dataCy('ag-overlay').invoke('text').should('contain', 'No rows available'); | ||
}); | ||
}); |
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,12 @@ | ||
<template> | ||
<div data-cy="ag-overlay" class="ag-overlay-loading-center"> | ||
<font-awesome-icon data-cy="warning-icon" :icon="['fas', 'circle-exclamation']" /> | ||
{{ props.params.noRowsMessage }} | ||
</div> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'; | ||
const props = defineProps<{ params: { noRowsMessage: string } }>(); | ||
</script> |
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,21 @@ | ||
import NoRowsOverlay from '@components/dumb/NoRowsOverlay.vue'; | ||
import type { Meta, StoryObj } from '@storybook/vue3'; | ||
|
||
const meta: Meta<typeof NoRowsOverlay> = { | ||
title: 'Dumb components/NoRowsOverlay', | ||
component: NoRowsOverlay, | ||
tags: ['autodocs'], | ||
argTypes: { | ||
params: { control: 'object' }, | ||
}, | ||
args: { | ||
params: { | ||
noRowsMessage: 'No rows available', | ||
}, | ||
}, | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof NoRowsOverlay>; | ||
|
||
export const Default: Story = {}; |