Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/analytics/usage_trends')
-rw-r--r--spec/frontend/analytics/usage_trends/components/app_spec.js6
-rw-r--r--spec/frontend/analytics/usage_trends/components/usage_trends_count_chart_spec.js12
-rw-r--r--spec/frontend/analytics/usage_trends/components/users_chart_spec.js8
-rw-r--r--spec/frontend/analytics/usage_trends/utils_spec.js6
4 files changed, 16 insertions, 16 deletions
diff --git a/spec/frontend/analytics/usage_trends/components/app_spec.js b/spec/frontend/analytics/usage_trends/components/app_spec.js
index 156be26f895..c732dc22322 100644
--- a/spec/frontend/analytics/usage_trends/components/app_spec.js
+++ b/spec/frontend/analytics/usage_trends/components/app_spec.js
@@ -21,13 +21,13 @@ describe('UsageTrendsApp', () => {
});
it('displays the usage counts component', () => {
- expect(wrapper.find(UsageCounts).exists()).toBe(true);
+ expect(wrapper.findComponent(UsageCounts).exists()).toBe(true);
});
['Total projects & groups', 'Pipelines', 'Issues & merge requests'].forEach((usage) => {
it(`displays the ${usage} chart`, () => {
const chartTitles = wrapper
- .findAll(UsageTrendsCountChart)
+ .findAllComponents(UsageTrendsCountChart)
.wrappers.map((chartComponent) => chartComponent.props('chartTitle'));
expect(chartTitles).toContain(usage);
@@ -35,6 +35,6 @@ describe('UsageTrendsApp', () => {
});
it('displays the users chart component', () => {
- expect(wrapper.find(UsersChart).exists()).toBe(true);
+ expect(wrapper.findComponent(UsersChart).exists()).toBe(true);
});
});
diff --git a/spec/frontend/analytics/usage_trends/components/usage_trends_count_chart_spec.js b/spec/frontend/analytics/usage_trends/components/usage_trends_count_chart_spec.js
index 02cf7f42a0b..ad6089f74b5 100644
--- a/spec/frontend/analytics/usage_trends/components/usage_trends_count_chart_spec.js
+++ b/spec/frontend/analytics/usage_trends/components/usage_trends_count_chart_spec.js
@@ -50,9 +50,9 @@ describe('UsageTrendsCountChart', () => {
wrapper = null;
});
- const findLoader = () => wrapper.find(ChartSkeletonLoader);
- const findChart = () => wrapper.find(GlLineChart);
- const findAlert = () => wrapper.find(GlAlert);
+ const findLoader = () => wrapper.findComponent(ChartSkeletonLoader);
+ const findChart = () => wrapper.findComponent(GlLineChart);
+ const findAlert = () => wrapper.findComponent(GlAlert);
describe('while loading', () => {
beforeEach(() => {
@@ -61,7 +61,7 @@ describe('UsageTrendsCountChart', () => {
});
it('requests data', () => {
- expect(queryHandler).toBeCalledTimes(1);
+ expect(queryHandler).toHaveBeenCalledTimes(1);
});
it('displays the skeleton loader', () => {
@@ -105,7 +105,7 @@ describe('UsageTrendsCountChart', () => {
});
it('requests data', () => {
- expect(queryHandler).toBeCalledTimes(1);
+ expect(queryHandler).toHaveBeenCalledTimes(1);
});
it('hides the skeleton loader', () => {
@@ -141,7 +141,7 @@ describe('UsageTrendsCountChart', () => {
});
it('requests data twice', () => {
- expect(queryHandler).toBeCalledTimes(2);
+ expect(queryHandler).toHaveBeenCalledTimes(2);
});
it('passes the data to the line chart', () => {
diff --git a/spec/frontend/analytics/usage_trends/components/users_chart_spec.js b/spec/frontend/analytics/usage_trends/components/users_chart_spec.js
index 32a664a5026..e7abd4d4323 100644
--- a/spec/frontend/analytics/usage_trends/components/users_chart_spec.js
+++ b/spec/frontend/analytics/usage_trends/components/users_chart_spec.js
@@ -47,9 +47,9 @@ describe('UsersChart', () => {
wrapper = null;
});
- const findLoader = () => wrapper.find(ChartSkeletonLoader);
- const findAlert = () => wrapper.find(GlAlert);
- const findChart = () => wrapper.find(GlAreaChart);
+ const findLoader = () => wrapper.findComponent(ChartSkeletonLoader);
+ const findAlert = () => wrapper.findComponent(GlAlert);
+ const findChart = () => wrapper.findComponent(GlAreaChart);
describe('while loading', () => {
beforeEach(() => {
@@ -139,7 +139,7 @@ describe('UsersChart', () => {
});
it('requests data twice', () => {
- expect(queryHandler).toBeCalledTimes(2);
+ expect(queryHandler).toHaveBeenCalledTimes(2);
});
it('calls fetchMore', () => {
diff --git a/spec/frontend/analytics/usage_trends/utils_spec.js b/spec/frontend/analytics/usage_trends/utils_spec.js
index 656f310dda7..9982e96735e 100644
--- a/spec/frontend/analytics/usage_trends/utils_spec.js
+++ b/spec/frontend/analytics/usage_trends/utils_spec.js
@@ -16,17 +16,17 @@ describe('getAverageByMonth', () => {
expect(getAverageByMonth(mockCountsData2)).toStrictEqual(countsMonthlyChartData2);
});
- it('it transforms a data point to the first of the month', () => {
+ it('transforms a data point to the first of the month', () => {
const item = mockCountsData1[0];
const firstOfTheMonth = item.recordedAt.replace(/-[0-9]{2}$/, '-01');
expect(getAverageByMonth([item])).toStrictEqual([[firstOfTheMonth, item.count]]);
});
- it('it uses sane defaults', () => {
+ it('uses sane defaults', () => {
expect(getAverageByMonth()).toStrictEqual([]);
});
- it('it errors when passing null', () => {
+ it('errors when passing null', () => {
expect(() => {
getAverageByMonth(null);
}).toThrow();