Skip to content

Commit 6b79af7

Browse files
committed
test: add test for rendering job name only
1 parent 2d0b882 commit 6b79af7

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

frontend/__tests__/components/WorkflowDashboard.test.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,17 @@ describe('<WorkflowDashboard />', () => {
230230
expect(workflowDashboardWrapper.html()).toMatchSnapshot();
231231
});
232232

233+
it('should render job name only', async () => {
234+
vi.spyOn(preferences, 'showJobNameOnly', 'get').mockReturnValueOnce(true);
235+
236+
fetchCctrayJson.mockResolvedValueOnce([jobDetails1, jobDetails2]);
237+
const workflowDashboardWrapper = mountWithWrapper(WorkflowDashboard);
238+
239+
await flushPromises();
240+
241+
expect(workflowDashboardWrapper.findComponent(Job).find('a').text()).toBe('Cancel Previous Runs');
242+
});
243+
233244
it.each([
234245
['branch_protection_rule', [{ ...jobDetails1, triggeredEvent: 'branch_protection_rule' }, jobDetails2]],
235246
['check_run', [{ ...jobDetails1, triggeredEvent: 'check_run' }, jobDetails2]],

frontend/vite.config.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ export default defineConfig({
4444
coverage: {
4545
reporter: ['text', 'html'],
4646
all: true,
47-
statements: 80.58,
48-
branches: 94.64,
49-
functions: 43.65,
50-
lines: 80.58,
47+
statements: 80.62,
48+
branches: 94.87,
49+
functions: 44.18,
50+
lines: 80.62,
5151
thresholdAutoUpdate: true
5252
},
5353
setupFiles: '__tests__/vitest.setup.js'

0 commit comments

Comments
 (0)