-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: set a CMS loading state while live editing is initializing
- Loading branch information
Showing
4 changed files
with
82 additions
and
3 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
54 changes: 54 additions & 0 deletions
54
javascript-modules/integration-tests/features/live/bookshop_live_loading.feature
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,54 @@ | ||
Feature: Bookshop CloudCannon Live Editing Loading | ||
|
||
Background: | ||
Given the file tree: | ||
""" | ||
package.json from starters/generate/package.json # <-- this .json line hurts my syntax highlighting | ||
component-lib/ | ||
go.mod from starters/hugo/components.go.mod | ||
config.toml from starters/hugo/components.config.toml | ||
bookshop/ | ||
bookshop.config.js from starters/hugo/bookshop.config.js | ||
site/ | ||
go.mod from starters/hugo/site.go.mod | ||
config.toml from starters/hugo/site.config.toml | ||
""" | ||
* a component-lib/components/single/single.hugo.html file containing: | ||
""" | ||
<h1>{{ .title }}</h1> | ||
""" | ||
* a site/layouts/index.html file containing: | ||
""" | ||
<html> | ||
<body> | ||
{{ partial "bookshop_bindings" `(dict "title" .Params.block.title)` }} | ||
{{ partial "bookshop" (slice "single" (dict "title" .Params.block.title)) }} | ||
</body> | ||
</html> | ||
""" | ||
* [front_matter]: | ||
""" | ||
block: | ||
title: "Hello There" | ||
""" | ||
* a site/content/_index.md file containing: | ||
""" | ||
--- | ||
[front_matter] | ||
--- | ||
""" | ||
* [ssg]: "hugo" | ||
|
||
@web | ||
Scenario: Bookshop live sets the CloudCannon loading state | ||
Given 🌐 I have loaded my site in CloudCannon | ||
When 🌐 CloudCannon pushes new yaml: | ||
""" | ||
block: | ||
title: "Rendered!" | ||
""" | ||
Then 🌐 There should be no errors | ||
* 🌐 There should be no logs | ||
* 🌐 "window.CloudCannon?.loadingMessages[0] === 'Loading Bookshop Live Editing'" should evaluate | ||
* 🌐 "window.CloudCannon?.loadingMessages[1] === false" should evaluate | ||
* 🌐 The selector h1 should contain "Rendered!" |
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