Skip to content

Commit

Permalink
bump
Browse files Browse the repository at this point in the history
  • Loading branch information
mikaelbr committed Feb 15, 2024
1 parent 8a66298 commit 1887ba2
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
15 changes: 12 additions & 3 deletions e2e-tests/assistant-view.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,26 @@ test('Should fetch Kristiansund - Molde and loading more after first result', as

await page.getByRole('textbox', { name: 'From' }).click();
await page.getByRole('textbox', { name: 'From' }).fill('Kristiansund');
await page.getByRole('option', { name: 'Kristiansund Kristiansund' }).click();
await page
.getByRole('option', { name: 'Kristiansund Kristiansund', exact: true })
.click();

await page.getByRole('textbox', { name: 'To' }).click();
await page.getByRole('textbox', { name: 'To' }).fill('Molde');

const initialRequest = page.waitForResponse((request) => {
return request.url().includes('trip') && request.url().includes('cursor');
});

await page.getByRole('option', { name: 'Molde Molde', exact: true }).click();

await initialRequest;

await page.getByRole('button', { name: 'More choices' }).click();
await page.getByText('Bus', { exact: true }).click();
await page.getByRole('button', { name: 'Find departures' }).click();

const tripPatternItem = page.getByTestId('trip-pattern-0');
const tripPatternItem = page.getByTestId('tripPattern-0-0');
await tripPatternItem.waitFor();

const additionalRequest = page.waitForRequest((request) => {
Expand Down Expand Up @@ -100,6 +109,6 @@ test('should show boats and message on Correspondance', async ({ page }) => {

await additionalRequest2;

await page.getByTestId('trip-pattern-0').click();
await page.getByTestId('tripPattern-0-0').click();
await expect(page.getByText('Correspondance between 1145')).toBeVisible();
});
2 changes: 1 addition & 1 deletion e2e-tests/fram-specific/line-filter.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ test('Should filter on line 701', async ({ page }) => {
await page.getByRole('button', { name: 'Find departures' }).click();
await tripResponse2;

const tripPatternItem2 = page.getByTestId('trip-pattern-0');
const tripPatternItem2 = page.getByTestId('tripPattern-0-0');
await tripPatternItem2.waitFor();

await expect(tripPatternItem2).toBeVisible();
Expand Down
1 change: 1 addition & 0 deletions src/page-modules/assistant/trip/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ export default function Trip({ tripQuery, fallback }: TripProps) {
tripPattern={tripPattern}
delay={i * 0.1}
index={i}
testId={`tripPattern-${tripIndex}-${i}`}
/>
</div>
)),
Expand Down
4 changes: 3 additions & 1 deletion src/page-modules/assistant/trip/trip-pattern/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@ type TripPatternProps = {
tripPattern: TripPatternType;
delay: number;
index: number;
testId?: string;
};

export default function TripPattern({
tripPattern,
delay,
index,
testId,
}: TripPatternProps) {
const { t, language } = useTranslation();

Expand Down Expand Up @@ -70,7 +72,7 @@ export default function TripPattern({
<motion.a
href={`/assistant/${tripPattern.compressedQuery}`}
className={className}
data-testid={`trip-pattern-${index}`}
data-testid={testId}
initial={{ opacity: 0, x: -10 }}
animate={{ opacity: maxOpacity, x: 0 }}
exit={{ opacity: 0, x: -10 }}
Expand Down

0 comments on commit 1887ba2

Please sign in to comment.