-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Playwright test for rearranging elements (#342)
This PR updates the Playwright test for rearranging elements so that it uses the new LocationPage. J=SLAP-2888 TEST=auto
- Loading branch information
1 parent
b24b850
commit c06d899
Showing
6 changed files
with
64 additions
and
20 deletions.
There are no files selected for viewing
Binary file modified
BIN
+33.6 KB
(190%)
...nshots__/darwin/rearrange-elements.spec.ts/can-rearrange-elements-in-tree-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed
BIN
-36.7 KB
...nshots__/darwin/rearrange-elements.spec.ts/can-rearrange-elements-in-tree-2.png
Binary file not shown.
Binary file modified
BIN
+20.7 KB
(180%)
...enshots__/win32/rearrange-elements.spec.ts/can-rearrange-elements-in-tree-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed
BIN
-24.6 KB
...enshots__/win32/rearrange-elements.spec.ts/can-rearrange-elements-in-tree-2.png
Binary file not shown.
56 changes: 46 additions & 10 deletions
56
e2e-tests/tests/__fixtures__/rearrange-elements-expected-page.tsx
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 |
---|---|---|
@@ -1,18 +1,54 @@ | ||
import { GetPath, TemplateProps } from "@yext/pages"; | ||
import Banner from "../components/Banner"; | ||
import Container from "../components/Container"; | ||
import { GetPath, TemplateConfig, TemplateProps } from "@yext/pages"; | ||
import AddressDisplay from "../components/AddressDisplay"; | ||
import BusinessInfo from "../components/BusinessInfo"; | ||
import Header from "../components/Header"; | ||
import HoursDisplay from "../components/HoursDisplay"; | ||
|
||
export const getPath: GetPath<TemplateProps> = () => { | ||
return "index.html"; | ||
export const config: TemplateConfig = { | ||
stream: { | ||
$id: "studio-stream-id-LocationPage", | ||
localization: { locales: ["en"], primary: false }, | ||
filter: { entityTypes: ["location"] }, | ||
fields: ["hours", "address", "slug"], | ||
}, | ||
}; | ||
export const getPath: GetPath<TemplateProps> = ({ | ||
document, | ||
}: TemplateProps) => { | ||
return `${document.slug}`; | ||
}; | ||
|
||
export default function BasicPage() { | ||
export default function LocationPage({ document }: TemplateProps) { | ||
return ( | ||
<> | ||
<Banner bool={false} num={0} /> | ||
<div> | ||
<Container /> | ||
</div> | ||
<Header | ||
title="Yext" | ||
logo="https://a.mktgcdn.com/p/R9FjcYjRNA5dAespqgHFLMvu2m18-E5Apnb3KON0oJY/300x300.png" | ||
backgroundColor="#BAD8FD" | ||
/> | ||
<BusinessInfo> | ||
<HoursDisplay | ||
monday={{ | ||
isClosed: false, | ||
openIntervals: document.hours.monday.openIntervals, | ||
}} | ||
tuesday={{ | ||
isClosed: false, | ||
openIntervals: document.hours.tuesday.openIntervals, | ||
}} | ||
wednesday={{ | ||
isClosed: false, | ||
openIntervals: document.hours.wednesday.openIntervals, | ||
}} | ||
/> | ||
<AddressDisplay | ||
line1={`${document.address.line1}`} | ||
city={`${document.address.city}`} | ||
region={`${document.address.region}`} | ||
postalCode={`${document.address.postalCode}`} | ||
countryCode="" | ||
/> | ||
</BusinessInfo> | ||
</> | ||
); | ||
} |
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