Skip to content

Commit

Permalink
feat: archived features will be included in onboarding (#8350)
Browse files Browse the repository at this point in the history
Now when you are finished onboarding and you archive feature, you will
not restart onboarding.
  • Loading branch information
sjaanus authored Oct 3, 2024
1 parent 38b33aa commit e8e005d
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
27 changes: 26 additions & 1 deletion src/lib/features/onboarding/onboarding-read-model.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ afterAll(async () => {
}
});

beforeEach(async () => {});
beforeEach(async () => {
await featureToggleStore.deleteAll();
});

test('can get instance onboarding durations', async () => {
const initialResult =
Expand Down Expand Up @@ -153,3 +155,26 @@ test('can get project onboarding status', async () => {
status: 'onboarded',
});
});

test('archived feature counts as onboarded', async () => {
await featureToggleStore.create('default', {
name: 'my-flag',
createdByUserId: SYSTEM_USER.id,
});

await lastSeenStore.setLastSeen([
{
environment: 'default',
featureName: 'my-flag',
},
]);

await featureToggleStore.archive('my-flag');

const onboardedResult =
await onboardingReadModel.getOnboardingStatusForProject('default');

expect(onboardedResult).toMatchObject({
status: 'onboarded',
});
});
1 change: 0 additions & 1 deletion src/lib/features/onboarding/onboarding-read-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ export class OnboardingReadModel implements IOnboardingReadModel {
const feature = await this.db('features')
.select('name')
.where('project', projectId)
.where('archived_at', null)
.first();

if (!feature) {
Expand Down

0 comments on commit e8e005d

Please sign in to comment.