import chai, {expect} from "chai";
import chaiAsPromised from "chai-as-promised"
import nock from "nock"
import fs from "fs-promise"

import portray from '../../index'

chai.should();
chai.use(chaiAsPromised);

describe('Steam', () => {
    describe('#find()', () => {

    })

    describe('#get()', () => {
        let results;

        before(async() => {
            let asset = __dirname + '/../assets/extractor/steam/appdetails.json';
            let jsonResults = await fs.readFile(asset);

            nock('http://store.steampowered.com')
                .get('/api/appdetails/?appids=239030')
                .reply(200, jsonResults);

            results = await portray.get('steam', 239030);
        });

        it('should return a portray results object', () => {
            results.should.include({
                'title': 'Papers, Please'
            });

            results.should.not.include({
                'random': 'data'
            });
        });
    });
});
