forked from rancher/dashboard
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
code cleanup + fix breaking logic on unit test with non-existance of …
…nodes to clone + add unit test (rancher#10737)
- Loading branch information
Showing
2 changed files
with
55 additions
and
6 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
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,43 @@ | ||
import { mount } from '@vue/test-utils'; | ||
import Carousel from '@shell/components/Carousel.vue'; | ||
|
||
describe('component: Carousel', () => { | ||
it('should render component with the correct data applied', async() => { | ||
const sliders = [ | ||
{ | ||
key: 'key-0', | ||
repoName: 'some-repo-name-0', | ||
chartNameDisplay: 'chart-name-display-0', | ||
chartDescription: 'chart-description-0' | ||
}, | ||
{ | ||
key: 'key-1', | ||
repoName: 'some-repo-name-1', | ||
chartNameDisplay: 'chart-name-display-1', | ||
chartDescription: 'chart-description-1' | ||
}, | ||
{ | ||
key: 'key-2', | ||
repoName: 'some-repo-name-2', | ||
chartNameDisplay: 'chart-name-display-2', | ||
chartDescription: 'chart-description-2' | ||
}, | ||
{ | ||
key: 'key-3', | ||
repoName: 'some-repo-name-3', | ||
chartNameDisplay: 'chart-name-display-3', | ||
chartDescription: 'chart-description-3' | ||
} | ||
]; | ||
|
||
const wrapper = mount(Carousel, { | ||
propsData: { sliders }, | ||
mocks: { $store: { getters: { clusterId: () => 'some-cluster-id' } } } | ||
}); | ||
|
||
// testing https://github.com/rancher/dashboard/issues/9975 | ||
sliders.forEach((slider, index) => { | ||
expect(wrapper.find(`#slide${ index } h1`).html()).toContain(slider.chartNameDisplay); | ||
}); | ||
}); | ||
}); |