Skip to content

Commit

Permalink
[Test] Enable unit test suite: api.test.ts (#490) (#495)
Browse files Browse the repository at this point in the history
All the unit tests related to unused newsfeed are temporarily
skipped at forking. To build a clean unit test, we decide to
check and enable all the working unit tests. This PR checks
and enables api.test.ts.

Signed-off-by: Anan Zhuang <[email protected]>
  • Loading branch information
ananzh authored and kavilla committed Jun 26, 2021
1 parent 6f9f011 commit 7b08aac
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/plugins/newsfeed/public/lib/api.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jest.mock('uuid', () => ({
v4: () => 'NEW_UUID',
}));

describe.skip('NewsfeedApiDriver', () => {
describe('NewsfeedApiDriver', () => {
const opensearchDashboardsVersion = '99.999.9-test_version'; // It'll remove the `-test_version` bit
const userLanguage = 'en';
const fetchInterval = 2000;
Expand All @@ -75,7 +75,7 @@ describe.skip('NewsfeedApiDriver', () => {
sinon.reset();
});

describe.skip('shouldFetch', () => {
describe('shouldFetch', () => {
it('defaults to true', () => {
const driver = getDriver();
expect(driver.shouldFetch()).toBe(true);
Expand All @@ -100,7 +100,7 @@ describe.skip('NewsfeedApiDriver', () => {
});
});

describe.skip('updateHashes', () => {
describe('updateHashes', () => {
it('returns previous and current storage', () => {
const driver = getDriver();
const items: NewsfeedItem[] = [
Expand Down Expand Up @@ -192,7 +192,7 @@ describe.skip('NewsfeedApiDriver', () => {
).toBe(false);
});

describe.skip('modelItems', () => {
describe('modelItems', () => {
it('Models empty set with defaults', () => {
const driver = getDriver();
const apiItems: ApiItem[] = [];
Expand Down Expand Up @@ -465,7 +465,7 @@ describe.skip('NewsfeedApiDriver', () => {
});
});

describe.skip('getApi', () => {
describe('getApi', () => {
const mockHttpGet = jest.fn();
let httpMock = ({
fetch: mockHttpGet,
Expand Down Expand Up @@ -630,7 +630,7 @@ describe.skip('getApi', () => {
});
});

describe.skip('Retry fetching', () => {
describe('Retry fetching', () => {
const successItems: ApiItem[] = [
{
title: { en: 'hasNew test' },
Expand Down

0 comments on commit 7b08aac

Please sign in to comment.