Commit 99098b5b authored by pburdette's avatar pburdette

Rename trace in job app spec

Few other instances of trace that
we can change in the spec.
parent ea5fb9e3
......@@ -47,9 +47,9 @@ describe('Job App', () => {
wrapper = mount(JobApp, { propsData: { ...props }, store });
};
const setupAndMount = ({ jobData = {}, traceData = {} } = {}) => {
const setupAndMount = ({ jobData = {}, jobLogData = {} } = {}) => {
mock.onGet(initSettings.endpoint).replyOnce(200, { ...job, ...jobData });
mock.onGet(`${initSettings.pagePath}/trace.json`).reply(200, traceData);
mock.onGet(`${initSettings.pagePath}/trace.json`).reply(200, jobLogData);
const asyncInit = store.dispatch('init', initSettings);
......@@ -77,11 +77,10 @@ describe('Job App', () => {
const findEmptyState = () => wrapper.find(EmptyState);
const findJobNewIssueLink = () => wrapper.find('[data-testid="job-new-issue"]');
const findJobEmptyStateTitle = () => wrapper.find('[data-testid="job-empty-state-title"]');
const findJobTraceScrollTop = () => wrapper.find('[data-testid="job-controller-scroll-top"]');
const findJobTraceScrollBottom = () =>
wrapper.find('[data-testid="job-controller-scroll-bottom"]');
const findJobTraceController = () => wrapper.find('[data-testid="job-raw-link-controller"]');
const findJobTraceEraseLink = () => wrapper.find('[data-testid="job-log-erase-link"]');
const findJobLogScrollTop = () => wrapper.find('[data-testid="job-controller-scroll-top"]');
const findJobLogScrollBottom = () => wrapper.find('[data-testid="job-controller-scroll-bottom"]');
const findJobLogController = () => wrapper.find('[data-testid="job-raw-link-controller"]');
const findJobLogEraseLink = () => wrapper.find('[data-testid="job-log-erase-link"]');
beforeEach(() => {
mock = new MockAdapter(axios);
......@@ -315,7 +314,7 @@ describe('Job App', () => {
});
describe('empty states block', () => {
it('renders empty state when job does not have trace and is not running', () =>
it('renders empty state when job does not have log and is not running', () =>
setupAndMount({
jobData: {
has_trace: false,
......@@ -342,7 +341,7 @@ describe('Job App', () => {
expect(findEmptyState().exists()).toBe(true);
}));
it('does not render empty state when job does not have trace but it is running', () =>
it('does not render empty state when job does not have log but it is running', () =>
setupAndMount({
jobData: {
has_trace: false,
......@@ -358,7 +357,7 @@ describe('Job App', () => {
expect(findEmptyState().exists()).toBe(false);
}));
it('does not render empty state when job has trace but it is not running', () =>
it('does not render empty state when job has log but it is not running', () =>
setupAndMount({ jobData: { has_trace: true } }).then(() => {
expect(findEmptyState().exists()).toBe(false);
}));
......@@ -424,10 +423,10 @@ describe('Job App', () => {
});
});
describe('trace controls', () => {
describe('job log controls', () => {
beforeEach(() =>
setupAndMount({
traceData: {
jobLogData: {
html: '<span>Update</span>',
status: 'success',
append: false,
......@@ -439,16 +438,16 @@ describe('Job App', () => {
);
it('should render scroll buttons', () => {
expect(findJobTraceScrollTop().exists()).toBe(true);
expect(findJobTraceScrollBottom().exists()).toBe(true);
expect(findJobLogScrollTop().exists()).toBe(true);
expect(findJobLogScrollBottom().exists()).toBe(true);
});
it('should render link to raw ouput', () => {
expect(findJobTraceController().exists()).toBe(true);
expect(findJobLogController().exists()).toBe(true);
});
it('should render link to erase job', () => {
expect(findJobTraceEraseLink().exists()).toBe(true);
expect(findJobLogEraseLink().exists()).toBe(true);
});
});
});
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment