Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Commit

Permalink
fix settings/general acceptance tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinansfield committed Feb 21, 2017
1 parent c1cd4c1 commit 1ff1a83
Show file tree
Hide file tree
Showing 5 changed files with 113 additions and 118 deletions.
2 changes: 1 addition & 1 deletion app/templates/components/gh-file-uploader.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</div>
</div>
{{#if failureMessage}}
<button class="gh-btn gh-btn-green" {{action "reset"}}><span>Try Again</span></button>
<button class="gh-btn gh-btn-green" {{action "reset"}} data-test-upload-try-again-button><span>Try Again</span></button>
{{/if}}
{{else}}
<div class="upload-form">
Expand Down
4 changes: 2 additions & 2 deletions app/templates/components/modals/delete-theme.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
</div>

<div class="modal-footer">
<button {{action "closeModal"}} class="gh-btn"><span>Cancel</span></button>
{{#gh-task-button task=deleteTheme class="gh-btn gh-btn-red"}}<span>Delete</span>{{/gh-task-button}}
<button {{action "closeModal"}} class="gh-btn" data-test-cancel-button><span>Cancel</span></button>
{{#gh-task-button task=deleteTheme class="gh-btn gh-btn-red" data-test-delete-button=true}}<span>Delete</span>{{/gh-task-button}}
</div>
8 changes: 4 additions & 4 deletions app/templates/components/modals/upload-theme.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -84,21 +84,21 @@
</div>

<div class="modal-footer">
<button {{action "closeModal"}} disabled={{closeDisabled}} class="gh-btn">
<button {{action "closeModal"}} disabled={{closeDisabled}} class="gh-btn" data-test-close-button>
<span>{{#if theme}}Close{{else}}Cancel{{/if}}</span>
</button>
{{#if displayOverwriteWarning}}
<button {{action "confirmOverwrite"}} class="gh-btn gh-btn-red">
<button {{action "confirmOverwrite"}} class="gh-btn gh-btn-red" data-test-overwrite-button>
<span>Overwrite</span>
</button>
{{/if}}
{{#if validationErrors}}
<button {{action "reset"}} class="gh-btn gh-btn-green">
<button {{action "reset"}} class="gh-btn gh-btn-green" data-test-try-again-button>
<span>Try Again</span>
</button>
{{/if}}
{{#if canActivateTheme}}
<button {{action "activate"}} class="gh-btn gh-btn-green">
<button {{action "activate"}} class="gh-btn gh-btn-green" data-test-activate-now-button>
<span>Activate Now</span>
</button>
{{/if}}
Expand Down
36 changes: 17 additions & 19 deletions app/templates/settings/general.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@
<div class="gh-setting-desc">The details used to identify your publication around the web</div>
<div class="gh-setting-content-extended">
{{#gh-form-group errors=model.errors hasValidated=model.hasValidated property="title"}}
{{gh-input model.title id="blog-title" name="general[title]" type="text" focusOut=(action "validate" "title" target=model) update=(action (mut model.title))}}
{{gh-input model.title type="text" focusOut=(action "validate" "title" target=model) update=(action (mut model.title)) data-test-title-input=true}}
{{gh-error-message errors=model.errors property="title"}}
<p>The name of your site</p>
{{/gh-form-group}}

{{#gh-form-group errors=model.errors hasValidated=model.hasValidated property="description" class="description-container"}}
{{gh-input model.description id="blog-description" name="general[description]" type="text" focusOut=(action "validate" "description" target=model) update=(action (mut model.description))}}
{{gh-input model.description type="text" focusOut=(action "validate" "description" target=model) update=(action (mut model.description)) data-test-description-input=true}}
{{gh-error-message errors=model.errors property="description"}}
<p>Used in your theme, meta data and search results</p>
{{/gh-form-group}}
</div>
</div>
<div class="gh-setting-action">
<button type="button" class="gh-btn gh-btn-hover-blue" {{action "exportData"}}><span>Close</span></button>
<button type="button" class="gh-btn gh-btn-hover-blue"><span>Close</span></button>
</div>
</div>
<div class="gh-setting">
Expand All @@ -43,7 +43,7 @@
</div>
</div>
<div class="gh-setting-action">
<button type="button" class="gh-btn gh-btn-hover-blue" {{action "exportData"}}><span>Close</span></button>
<button type="button" class="gh-btn gh-btn-hover-blue"><span>Close</span></button>
</div>
</div>

Expand All @@ -57,7 +57,7 @@
{{#if model.icon}}
<img class="blog-icon" src="{{model.icon}}" alt="icon" role="button" {{action "toggleUploadIconModal"}}>
{{else}}
<button type="button" class="gh-btn js-modal-logo" {{action "toggleUploadIconModal"}}><span>Upload Image</span></button>
<button type="button" class="gh-btn" {{action "toggleUploadIconModal"}}><span>Upload Image</span></button>
{{/if}}

{{#if showUploadIconModal}}
Expand All @@ -77,7 +77,7 @@
{{#if model.logo}}
<img class="blog-logo" src="{{model.logo}}" alt="logo" role="button" {{action "toggleUploadLogoModal"}}>
{{else}}
<button type="button" class="gh-btn js-modal-logo" {{action "toggleUploadLogoModal"}}><span>Upload Image</span></button>
<button type="button" class="gh-btn" {{action "toggleUploadLogoModal"}}><span>Upload Image</span></button>
{{/if}}

{{#if showUploadLogoModal}}
Expand All @@ -97,7 +97,7 @@
{{#if model.cover}}
<img class="blog-cover" src="{{model.cover}}" alt="cover photo" role="button" {{action "toggleUploadCoverModal"}}>
{{else}}
<button type="button" class="gh-btn js-modal-cover" {{action "toggleUploadCoverModal"}}><span>Upload Image</span></button>
<button type="button" class="gh-btn" {{action "toggleUploadCoverModal"}}><span>Upload Image</span></button>
{{/if}}

{{#if showUploadCoverModal}}
Expand All @@ -116,19 +116,19 @@
<div class="gh-setting-desc">Link your social accounts for full structured data and rich card support</div>
<div class="gh-setting-content-extended">
{{#gh-form-group errors=model.errors hasValidated=model.hasValidated property="facebook"}}
<input value={{model.facebook}} oninput={{action (mut _scratchFacebook) value="target.value"}} {{action "validateFacebookUrl" on="focusOut"}} type="url" class="gh-input" id="facebook" name="general[facebook]" placeholder="https://www.facebook.com/ghost" autocorrect="off" />
{{gh-error-message errors=model.errors property="facebook"}}
<input value={{model.facebook}} oninput={{action (mut _scratchFacebook) value="target.value"}} {{action "validateFacebookUrl" on="focusOut"}} type="url" class="gh-input" placeholder="https://www.facebook.com/ghost" autocorrect="off" data-test-facebook-input />
{{gh-error-message errors=model.errors property="facebook" data-test-facebook-error=true}}
<p>URL of your publication's Facebook Page</p>
{{/gh-form-group}}
{{#gh-form-group errors=model.errors hasValidated=model.hasValidated property="twitter"}}
<input value={{model.twitter}} oninput={{action (mut _scratchTwitter) value="target.value"}} {{action "validateTwitterUrl" on="focusOut"}} type="url" class="gh-input" id="facebook" name="general[twitter]" placeholder="https://twitter.com/tryghost" autocorrect="off" />
{{gh-error-message errors=model.errors property="twitter"}}
<input value={{model.twitter}} oninput={{action (mut _scratchTwitter) value="target.value"}} {{action "validateTwitterUrl" on="focusOut"}} type="url" class="gh-input" placeholder="https://twitter.com/tryghost" autocorrect="off" data-test-twitter-input />
{{gh-error-message errors=model.errors property="twitter" data-test-twitter-error=true}}
<p>URL of your publication's Twitter profile</p>
{{/gh-form-group}}
</div>
</div>
<div class="gh-setting-action">
<button type="button" class="gh-btn gh-btn-hover-blue" {{action "exportData"}}><span>Close</span></button>
<button type="button" class="gh-btn gh-btn-hover-blue"><span>Close</span></button>
</div>
</div>

Expand All @@ -139,7 +139,7 @@
<div class="gh-setting-desc">Include the date in your post URLs, eg. <strong>blogurl.com/2017/01/post-title/</strong></div>
</div>
<div class="gh-setting-action">
{{one-way-checkbox isDatedPermalinks id="permalinks" name="general[permalinks]" type="checkbox" update=(action (mut isDatedPermalinks))}}
{{one-way-checkbox isDatedPermalinks type="checkbox" update=(action (mut isDatedPermalinks)) data-test-dated-permalinks-checkbox=true}}
<span class="input-toggle-component"></span>
</div>
</div>
Expand All @@ -150,23 +150,21 @@
{{#if model.isPrivate}}
<div class="gh-setting-content-extended">
{{#gh-form-group errors=model.errors hasValidated=model.hasValidated property="password"}}
{{gh-input model.password name="general[password]" type="text" focusOut=(action "validate" "password" target=model) update=(action (mut model.password))}}
{{gh-error-message errors=model.errors property="password"}}
{{gh-input model.password name="general[password]" type="text" focusOut=(action "validate" "password" target=model) update=(action (mut model.password)) data-test-password-input=true}}
{{gh-error-message errors=model.errors property="password" data-test-password-error=true}}
<p>Set the password for this site</p>
{{/gh-form-group}}
</div>
{{/if}}
</div>
<div class="gh-setting-action">
{{one-way-checkbox model.isPrivate id="isPrivate" name="general[isPrivate]" type="checkbox" update=(action (mut model.isPrivate))}}
{{one-way-checkbox model.isPrivate type="checkbox" update=(action (mut model.isPrivate)) data-test-private-checkbox=true}}
<span class="input-toggle-component"></span>
</div>
</div>


<form id="settings-general" novalidate="novalidate">


<div class="settings-themes">
<h3 id="themes">Themes</h3>

Expand All @@ -177,7 +175,7 @@
deleteTheme=(action "deleteTheme")}}

<div class="form-group">
{{#link-to "settings.general.uploadtheme" class="gh-btn gh-btn-green"}}
{{#link-to "settings.general.uploadtheme" class="gh-btn gh-btn-green" data-test-upload-theme-button=true}}
<span>Upload a theme</span>
{{/link-to}}
</div>
Expand Down
Loading

0 comments on commit 1ff1a83

Please sign in to comment.