-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add route locked content component (#357)
Co-authored-by: Šimon Macek <simon.macek@proficio.cz>
- Loading branch information
1 parent
6f4cfa6
commit 7ec4822
Showing
8 changed files
with
114 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
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,55 @@ | ||
import RouteLockedContent from 'components/routes/RouteLockedContent.vue'; | ||
import { i18n } from '../../boot/i18n'; | ||
import { rideToWorkByBikeConfig } from 'src/boot/global_vars'; | ||
|
||
describe('<RouteLockedContent>', () => { | ||
it('has translation for all strings', () => { | ||
cy.testLanguageStringsInContext( | ||
['hintLockedSection', 'hintWatchVideo'], | ||
'routes', | ||
i18n, | ||
); | ||
}); | ||
|
||
context('desktop', () => { | ||
beforeEach(() => { | ||
cy.mount(RouteLockedContent, { | ||
props: {}, | ||
}); | ||
cy.viewport('macbook-16'); | ||
}); | ||
|
||
coreTests(); | ||
}); | ||
|
||
context('mobile', () => { | ||
beforeEach(() => { | ||
cy.mount(RouteLockedContent, { | ||
props: {}, | ||
}); | ||
cy.viewport('iphone-6'); | ||
}); | ||
|
||
coreTests(); | ||
}); | ||
}); | ||
|
||
function coreTests() { | ||
it('renders component', () => { | ||
cy.dataCy('route-locked-content').should('be.visible'); | ||
cy.dataCy('route-locked-hint-section') | ||
.should('be.visible') | ||
.and('have.css', 'font-size', '14px') | ||
.and('have.css', 'font-weight', '500') | ||
.and('contain', i18n.global.t('routes.hintLockedSection')); | ||
cy.dataCy('route-locked-hint-video') | ||
.should('be.visible') | ||
.and('have.css', 'font-size', '14px') | ||
.and('have.css', 'font-weight', '700') | ||
.and('contain', i18n.global.t('routes.hintWatchVideo')); | ||
cy.dataCy('route-locked-video').should('be.visible'); | ||
cy.dataCy('route-locked-video') | ||
.find('iframe') | ||
.should('have.attr', 'src', rideToWorkByBikeConfig.urlVideoLoggingRoutes); | ||
}); | ||
} |
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,49 @@ | ||
<script lang="ts"> | ||
/** | ||
* RouteLockedContent Component | ||
* | ||
* @description * Use this component to display information in routes tab | ||
* when route is locked. | ||
* | ||
* @example | ||
* <route-locked-content></route-locked-content> | ||
* | ||
* @see [Figma Design](https://www.figma.com/file/L8dVREySVXxh3X12TcFDdR/Do-pr%C3%A1ce-na-kole?type=design&node-id=4858%3A106366&mode=dev) | ||
*/ | ||
// libraries | ||
import { defineComponent } from 'vue'; | ||
// config | ||
import { rideToWorkByBikeConfig } from '../../boot/global_vars'; | ||
export default defineComponent({ | ||
name: 'RouteLockedContent', | ||
setup() { | ||
const { urlVideoLoggingRoutes } = rideToWorkByBikeConfig; | ||
return { | ||
urlVideoLoggingRoutes, | ||
}; | ||
}, | ||
}); | ||
</script> | ||
|
||
<template> | ||
<div data-cy="route-locked-content"> | ||
<div class="text-center text-subtitle2"> | ||
<p class="text-black" data-cy="route-locked-hint-section"> | ||
{{ $t('routes.hintLockedSection') }} | ||
</p> | ||
<p class="text-black text-weight-bold" data-cy="route-locked-hint-video"> | ||
{{ $t('routes.hintWatchVideo') }} | ||
</p> | ||
</div> | ||
<q-video | ||
:ratio="16 / 9" | ||
:src="urlVideoLoggingRoutes" | ||
class="q-mt-lg" | ||
data-cy="route-locked-video" | ||
/> | ||
</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
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