{"size": 5396, "ext": "js", "max_stars_repo_path": "test/server/cards/04-MM/NovuDynamo.spec.js", "max_stars_repo_name": "saluk/keyteki", "max_stars_repo_stars_event_min_datetime": "2020-10-08T17:43:30.000Z", "max_stars_repo_stars_event_max_datetime": "2020-10-08T17:43:30.000Z", "max_issues_repo_path": "test/server/cards/04-MM/NovuDynamo.spec.js", "max_issues_repo_name": "saluk/keyteki", "max_issues_repo_issues_event_min_datetime": "2020-08-14T21:05:49.000Z", "max_issues_repo_issues_event_max_datetime": "2020-09-12T08:34:09.000Z", "max_forks_repo_path": "test/server/cards/04-MM/NovuDynamo.spec.js", "max_forks_repo_name": "saluk/keyteki", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": 2, "max_forks_count": null, "avg_line_length": 43.5161290323, "max_line_length": 92, "alphanum_fraction": 0.4816530764}
describe('novu-dynamo', function () {
    describe("Novu-Dynamo's constant ability", function () {
        beforeEach(function () {
            this.setupTest({
                player1: {
                    house: 'logos',
                    archives: ['snufflegator', 'library-access'],
                    hand: ['eyegor', 'anger'],
                    inPlay: ['novu-dynamo'],
                    amber: 0
                },
                player2: {
                    inPlay: ['helper-bot']
                }
            });
            this.player1.endTurn();
            this.player2.clickPrompt('logos');
            this.player2.endTurn();
        });

        describe('and the ability is triggered', function () {
            it('selects a logos card from hand or archives', function () {
                expect(this.player1).toBeAbleToSelect(this.eyegor);
                expect(this.player1).toBeAbleToSelect(this.libraryAccess);
                expect(this.player1).toBeAbleToSelect(this.novuDynamo);
                expect(this.player1).not.toBeAbleToSelect(this.snufflegator);
                expect(this.player1).not.toBeAbleToSelect(this.anger);
            });

            describe('discard from hand', function () {
                beforeEach(function () {
                    this.player1.clickCard(this.eyegor);
                });

                it('and gain amber', function () {
                    expect(this.eyegor.location).toBe('discard');
                    expect(this.novuDynamo.location).toBe('play area');
                    expect(this.player1.amber).toBe(1);
                });

                describe('Trigger again', function () {
                    beforeEach(function () {
                        this.player1.clickPrompt('logos');
                        this.player1.clickPrompt('no');
                        this.player1.endTurn();
                        this.player2.clickPrompt('logos');
                        this.player2.endTurn();
                    });

                    it('selects a logos card from hand or archives', function () {
                        expect(this.player1).not.toBeAbleToSelect(this.eyegor);
                        expect(this.player1).toBeAbleToSelect(this.libraryAccess);
                        expect(this.player1).toBeAbleToSelect(this.novuDynamo);
                        expect(this.player1).not.toBeAbleToSelect(this.snufflegator);
                        expect(this.player1).not.toBeAbleToSelect(this.anger);
                    });

                    describe('discard from archive', function () {
                        beforeEach(function () {
                            this.player1.clickCard(this.libraryAccess);
                        });
                        it('gives amber', function () {
                            expect(this.libraryAccess.location).toBe('discard');
                            expect(this.novuDynamo.location).toBe('play area');
                            expect(this.player1.amber).toBe(2);
                        });
                    });
                });
            });

            describe('discard from archive', function () {
                beforeEach(function () {
                    this.player1.clickCard(this.libraryAccess);
                });
                it('gives amber', function () {
                    expect(this.libraryAccess.location).toBe('discard');
                    expect(this.novuDynamo.location).toBe('play area');
                    expect(this.player1.amber).toBe(1);
                });
            });

            describe('destroy Novu Dynamo', function () {
                beforeEach(function () {
                    this.player1.clickCard(this.novuDynamo);
                });

                it('should destroy Novu Dynamo end effect', function () {
                    expect(this.libraryAccess.location).toBe('archives');
                    expect(this.eyegor.location).toBe('hand');
                    expect(this.player1.amber).toBe(0);
                    expect(this.novuDynamo.location).toBe('discard');
                });
            });
        });

        describe('and the ability is triggered and AP can forge key', function () {
            beforeEach(function () {
                this.player1.player.amber = 5;
            });

            it('selects a logos card from hand or archives', function () {
                expect(this.player1).toBeAbleToSelect(this.eyegor);
                expect(this.player1).toBeAbleToSelect(this.libraryAccess);
                expect(this.player1).toBeAbleToSelect(this.novuDynamo);
                expect(this.player1).not.toBeAbleToSelect(this.snufflegator);
                expect(this.player1).not.toBeAbleToSelect(this.anger);
            });

            describe('discard from hand', function () {
                beforeEach(function () {
                    this.player1.clickCard(this.eyegor);
                });

                it('and gain amber and be able to forge', function () {
                    expect(this.eyegor.location).toBe('discard');
                    expect(this.novuDynamo.location).toBe('play area');
                    expect(this.player1.amber).toBe(6);
                    expect(this.player1).toHavePrompt('Which key would you like to forge?');
                });
            });
        });
    });
});
