-
Notifications
You must be signed in to change notification settings - Fork 16
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 #2738 from digitalfabrik/2699-appointment-booking-…
…offer 2699: Support appointment booking offer
- Loading branch information
Showing
21 changed files
with
319 additions
and
104 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
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,48 @@ | ||
import { fireEvent } from '@testing-library/react-native' | ||
import React from 'react' | ||
|
||
import { TileModel } from 'shared' | ||
|
||
import render from '../../testing/render' | ||
import openExternalUrl from '../../utils/openExternalUrl' | ||
import Tile from '../Tile' | ||
|
||
jest.mock('../../utils/openExternalUrl', () => jest.fn(async () => undefined)) | ||
|
||
describe('Tile', () => { | ||
const onTilePress = jest.fn() | ||
|
||
beforeEach(() => { | ||
jest.clearAllMocks() | ||
}) | ||
|
||
it('should call onTilePress', () => { | ||
const tile = new TileModel({ | ||
title: 'my category tile', | ||
path: '/example/category/path', | ||
thumbnail: null, | ||
isExternalUrl: false, | ||
}) | ||
const { getByText } = render(<Tile tile={tile} onTilePress={onTilePress} resourceCache={{}} />) | ||
fireEvent.press(getByText(tile.title)) | ||
|
||
expect(onTilePress).toHaveBeenCalledTimes(1) | ||
expect(onTilePress).toHaveBeenCalledWith(tile) | ||
expect(openExternalUrl).not.toHaveBeenCalled() | ||
}) | ||
|
||
it('should open external url', () => { | ||
const tile = new TileModel({ | ||
title: 'my category tile', | ||
path: 'https://example.com/test', | ||
thumbnail: null, | ||
isExternalUrl: true, | ||
}) | ||
const { getByText } = render(<Tile tile={tile} onTilePress={onTilePress} resourceCache={{}} />) | ||
fireEvent.press(getByText(tile.title)) | ||
|
||
expect(openExternalUrl).toHaveBeenCalledTimes(1) | ||
expect(openExternalUrl).toHaveBeenCalledWith(tile.path, expect.anything()) | ||
expect(onTilePress).not.toHaveBeenCalled() | ||
}) | ||
}) |
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,7 @@ | ||
issue_key: 2699 | ||
show_in_stores: false | ||
platforms: | ||
- android | ||
- ios | ||
- web | ||
en: Support appointment booking and other external embedded offers |
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
Oops, something went wrong.