Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandermendes committed Nov 5, 2017
1 parent 77972ee commit 8ec71f1
Show file tree
Hide file tree
Showing 16 changed files with 137 additions and 169 deletions.
5 changes: 3 additions & 2 deletions .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@
],
"plugins": [
["module-resolver", {
"root": ["./"],
"alias": {
"~": "./",
"@": "./"
"~": ".",
"@": "."
}
}]
]
Expand Down
7 changes: 2 additions & 5 deletions components/navbars/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,9 @@
<div role="separator" class="dropdown-divider"></div>
<b-dropdown-item
:to="{
name: 'project-open',
params: {
name: currentUser.name
}
name: 'project-open'
}">
Projects Admin
Project Admin
</b-dropdown-item>
<b-dropdown-item
:to="{
Expand Down
7 changes: 2 additions & 5 deletions components/navbars/Collection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,9 @@
<div role="separator" class="dropdown-divider"></div>
<b-dropdown-item
:to="{
name: 'project-open',
params: {
name: currentUser.name
}
name: 'project-open'
}">
Projects Admin
Project Admin
</b-dropdown-item>
<b-dropdown-item
:to="{
Expand Down
4 changes: 2 additions & 2 deletions test/fixtures/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@ export const routes = [
name: 'project-short_name-settings'
},
{
path: '/account/:name?/projects',
path: '/project/open',
component: jest.fn(),
name: 'account-name-projects'
name: 'project-open'
},
{
path: '/account/:name?/announcements',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,7 @@ exports[`ProjectContrib button is active by default 1`] = `
`;

exports[`ProjectContrib button is disabled when status is cannot_completed 1`] = `
<a tabindex="-1"
href="#"
target="_self"
aria-disabled="true"
data-server-rendered="true"
class="btn btn-success btn-block disabled disabled"
>
Contribute
</a>
`;

exports[`ProjectContrib button is disabled when status is completed 1`] = `
exports[`ProjectContrib button is disabled when project is completed 1`] = `
<a tabindex="-1"
href="#"
Expand Down
19 changes: 5 additions & 14 deletions test/unit/specs/components/buttons/projectContrib.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,12 @@ describe('ProjectContrib button', () => {
})
})

it('is disabled when status is completed', () => {
it('is disabled when project is completed', () => {
let completedProject = {
overall_progress: 100
}
wrapper.setProps({
status: 'completed',
shortname: 'my_project'
})
const renderer = require('vue-server-renderer').createRenderer()
renderer.renderToString(wrapper.vm, (err, str) => {
expect(str).toMatchSnapshot()
})
})

it('is disabled when status is cannot_completed', () => {
wrapper.setProps({
status: 'cannot_contribute',
shortname: 'my_project'
project: completedProject
})
const renderer = require('vue-server-renderer').createRenderer()
renderer.renderToString(wrapper.vm, (err, str) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,8 @@ exports[`Bar chart renders correctly 1`] = `
</div>
</div>
<div class="card-body">
<vue-chartist type="Bar"
data="[object Object]"
options="[object Object]"
>
</vue-chartist>
<div>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,8 @@ exports[`Line chart renders correctly 1`] = `
</div>
</div>
<div class="card-body">
<vue-chartist type="Line"
data="[object Object]"
options="[object Object]"
>
</vue-chartist>
<div>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,8 @@ exports[`Pie chart renders correctly 1`] = `
</div>
</div>
<div class="card-body">
<vue-chartist type="Pie"
data="[object Object]"
options="[object Object]"
>
</vue-chartist>
<div>
</div>
</div>
</div>
Expand Down
17 changes: 5 additions & 12 deletions test/unit/specs/components/navbars/__snapshots__/app.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ exports[`App navbar renders correctly when signed in as admin 1`] = `
>
<button id="announcements-toggle"
type="button"
class="nav-item d-none d-lg-flex flex-row btn btn-secondary"
class="nav-link d-none d-lg-flex flex-row btn btn-secondary"
>
<icon name="bell">
</icon>
Expand Down Expand Up @@ -94,25 +94,19 @@ exports[`App navbar renders correctly when signed in as admin 1`] = `
class="dropdown-divider"
>
</div>
<a href="#/account/JohnDoe/projects"
<a href="#/project/open"
role="menuitem"
target="_self"
class="dropdown-item"
>
Open Project
Project Admin
</a>
</span>
<span>
<div role="separator"
class="dropdown-divider"
>
</div>
<a href="#/admin/dashboard"
role="menuitem"
target="_self"
class="dropdown-item"
>
Admin
Site Admin
</a>
</span>
<div role="separator"
Expand Down Expand Up @@ -160,7 +154,7 @@ exports[`App navbar renders correctly when signed in as non-admin 1`] = `
>
<button id="announcements-toggle"
type="button"
class="nav-item d-none d-lg-flex flex-row btn btn-secondary"
class="nav-link d-none d-lg-flex flex-row btn btn-secondary"
>
<icon name="bell">
</icon>
Expand Down Expand Up @@ -225,7 +219,6 @@ exports[`App navbar renders correctly when signed in as non-admin 1`] = `
Settings
</a>
<!---->
<!---->
<div role="separator"
class="dropdown-divider"
>
Expand Down
Loading

0 comments on commit 8ec71f1

Please sign in to comment.