mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-25 14:17:31 +00:00
903868c08c
The release notice moves to 5.2.1 and gets a tile across the release column with the App Store and Google Play cards, each with a QR code that opens the store page. The headliner, intro, footnote and note texts are shorter so the tile fits, in every locale. Settings > Account shows the same store cards in its right column, except inside the native app itself. The user menu footer adds round links to Patreon, Ko-fi and Buy Me a Coffee beside Discord, left out on managed installs and in the native apps like every donation link.
40 lines
1.7 KiB
TypeScript
40 lines
1.7 KiB
TypeScript
// FE-APPSTORE-001 to FE-APPSTORE-003
|
|
import { describe, expect, it } from 'vitest';
|
|
import { render } from '../../../tests/helpers/render';
|
|
import AppStoreCards from './AppStoreCards';
|
|
|
|
describe('AppStoreCards', () => {
|
|
it('FE-APPSTORE-001: links both stores in a new tab, each with its QR code', () => {
|
|
render(<AppStoreCards />);
|
|
const cards = [...document.querySelectorAll<HTMLAnchorElement>('a.asc-card')];
|
|
expect(cards.map((a) => a.href)).toEqual([
|
|
'https://apps.apple.com/app/id6831237775',
|
|
'https://play.google.com/store/apps/details?id=com.liketrek.trek',
|
|
]);
|
|
for (const a of cards) {
|
|
expect(a).toHaveAttribute('target', '_blank');
|
|
expect(a).toHaveAttribute('rel', 'noopener noreferrer');
|
|
expect(a.querySelector('.asc-qr path')?.getAttribute('d')).toMatch(/^M0 0\.5h7/);
|
|
}
|
|
});
|
|
|
|
it('FE-APPSTORE-002: names each store and translates the lines around it', () => {
|
|
render(<AppStoreCards />);
|
|
const [ios, android] = document.querySelectorAll('a.asc-card');
|
|
expect(ios).toHaveTextContent('Download on the');
|
|
expect(ios).toHaveTextContent('App Store');
|
|
expect(ios).toHaveTextContent('iPhone and iPad');
|
|
expect(android).toHaveTextContent('Get it on');
|
|
expect(android).toHaveTextContent('Google Play');
|
|
expect(android).toHaveTextContent('Phone and tablet');
|
|
});
|
|
|
|
it('FE-APPSTORE-003: the dark tone marks the row, the theme tone does not', () => {
|
|
const { unmount } = render(<AppStoreCards tone="dark" className="x" />);
|
|
expect(document.querySelector('.asc-row')).toHaveClass('asc-dark', 'x');
|
|
unmount();
|
|
render(<AppStoreCards />);
|
|
expect(document.querySelector('.asc-row')).not.toHaveClass('asc-dark');
|
|
});
|
|
});
|